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, at runtime, for the specific information it needs to achieve its task.
The pseudo steps for adding knowledge to an Agent are:
knowledge_retriever
function with the following signature:search_knowledge_base()
and is used by the Agent to retrieve references from the knowledge.
For more details check out the Custom Retriever page.Chunk the information
Load the knowledge
Search the knowledge
aload()
method:
add_content()
function is sync. You can also call add_content_async()
for async usage.
Using add_content_async()
ensures you take full advantage of the non-blocking operations, concurrent processing, and reduced latency that async vector database operations offer. We recommend this approach, which is especially valuable in production environments with high throughput requirements.
For more details on vector database async capabilities, see the Vector Database Introduction.
Knowledge content needs to be read before it can be passed to any VectorDB for chunking, embedding and storage.
For more details on readers, auto selection and content types, see the Content Types page.