update the logic so that all context can fit into smaller context length #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
graph TB subgraph Input A[Large Context] end subgraph "Context Processing" B[Split Into Chunks] C1[Process Chunk 1] C2[Process Chunk 2] C3[Process Chunk N] D[Combine Notes/Comments] end subgraph "Iterative Refinement" E1[Search Planning] E2[Writing Planning] F1[Generate Queries/Next Steps] F2[Refine Writing Plan] G1[Final Search Decision] G2[Final Report Writing] end A --> B B --> C1 B --> C2 B --> C3 C1 --> D C2 --> D C3 --> D D --> E1 D --> E2 E1 --> F1 E2 --> F2 F1 --> G1 F2 --> G2 style A fill:#f9f,stroke:#333,stroke-width:2px style G1 fill:#ccf,stroke:#333,stroke-width:2px style G2 fill:#ccf,stroke:#333,stroke-width:2px classDef chunk fill:#fcf,stroke:#333,stroke-width:1px class C1,C2,C3 chunk classDef process fill:#cfc,stroke:#333,stroke-width:1px class B,D,E1,E2,F1,F2 processNow token number will be estimated and split into chunks, either leave comments per chunk or refine based on chunks