Knowledge is domain-specific information that the Agent can search at runtime to make better decisions (dynamic few-shot learning) and provide accurate responses (agentic RAG).
Dynamic Few-Shot Learning: Text2Sql Agent
knowledge
to an Agent, it will search this knowledge base, at runtime, for the specific information it needs to achieve its task.
The pseudo steps for adding knowledge to an Agent are:
search_knowledge=True
to add a search_knowledge_base()
tool to the Agent. search_knowledge
is True
by default if you add knowledge
to an Agent.add_references=True
to automatically add references from the knowledge base to the Agent’s prompt. This is the traditional 2023 RAG approach.retriever
function with the following signature:search_knowledge_base()
and is used by the Agent to retrieve references from the knowledge base.
For more details check out the Custom Retriever page.Chunk the information
Load the knowledge base
Search the knowledge base
aload()
method:
aload()
ensures you take full advantage of the non-blocking operations, concurrent processing, and reduced latency that async vector database operations offer. This is especially valuable in production environments with high throughput requirements.
For more details on vector database async capabilities, see the Vector Database Introduction.
Use one of the following knowledge bases to simplify the chunking, loading, searching and optimization process: