Description
Add a new command named retrieve
(or similar) that allows the agent to query an index in an external vector database specified in the environment.
Rationale
It would be useful to allow the agent to process data that has been ingested into a vector database in advance, such as user documents or codebases. For example, a security auditor might want to task the agent to analyze a particular function or part of the logic of some codebase. If the code was indexed in a database, the agent can first query the relevant parts of the code and store them in its context, and reason about them in subsequent steps.
Implementation details
One option would be to add new .env variables called EXTERNAL_VECTORSTORE_TYPE
and EXTERNAL_VECTORSTORE_INDEX
or similar. The same types that are already implemented for short-term memory could be supported. If these environment keys are set, (conditionally) add information about the retrieval_query
and index name to the prompt.
The tricky part is to incorporate the query results into the context without running into size limits. Some refactoring of the code that manages the context might be required.
Docs & testing
If this feature is implemented, we should also provide a full tutorial for using the feature.
This feature should be tested extensively with several use-cases before being merged into the main codebase.
Activity