Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Chunking large inputs #28

Open
rihp opened this issue Jul 14, 2023 · 2 comments
Open

Feat: Chunking large inputs #28

rihp opened this issue Jul 14, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@rihp
Copy link
Collaborator

rihp commented Jul 14, 2023

There are some cases where the result of an invokation is very long and exceeds the token window limit

In those cases we can implement some type of chunking mechanism that processes the input in batches that the LLM can handle.

For some reference see this issue and specifically this comment

The idea would be to apply the following new steps when sending a message to the agent:

  1. Create an env variable to set the chunking size
  2. When the agent is about to process any input, check the length of the input with tiktoken
  3. If the input is larger than the context window, chunk it based on env config length.
  4. Save the output in a variable
  5. Process the next chunk and append the result to the previous variable to update its contents with the new information.
  6. Repeat the process until you´ve processed all the chunks
  7. Return the combination of all the responses to the chunked bits
@rihp
Copy link
Collaborator Author

rihp commented Jul 14, 2023

This one is being implemented and works as a Proof of Concept in #29

@rihp rihp added the enhancement New feature or request label Jul 31, 2023
@rihp
Copy link
Collaborator Author

rihp commented Aug 1, 2023

The summarization module was refactored,

today, I think we should remove the summarization of permanent messages as it messages with the initialization prompt, the user goal and the loaded wraps.

Essentially removing this line or implementing it differently

await this._summarize("persistent");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant