Understanding knowledge and how to use it with Agno agents
knowledge
to an Agent, it will search this knowledge base, at runtime, for the specific information it needs to achieve its task.
For example:
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_knowledge_to_context=True
to automatically add references from the knowledge base to the Agent’s context, based in your user message. This is the traditional RAG approach.knowledge_retriever
function with the following signature:
search_knowledge_base()
and is used by the Agent to retrieve references from the knowledge base.
knowledge_retriever
parameter.Field | Type | Description |
---|---|---|
id | str | The unique identifier for the knowledge content. |
name | str | The name of the knowledge content. |
description | str | The description of the knowledge content. |
metadata | dict | The metadata for the knowledge content. |
type | str | The type of the knowledge content. |
size | int | The size of the knowledge content. Applicable only to files. |
linked_to | str | The ID of the knowledge content that this content is linked to. |
access_count | int | The number of times this content has been accessed. |
status | str | The status of the knowledge content. |
status_message | str | The message associated with the status of the knowledge content. |
created_at | int | The timestamp when the knowledge content was created. |
updated_at | int | The timestamp when the knowledge content was last updated. |
external_id | str | The external ID of the knowledge content. Used when external vector stores are used, like LightRAG. |
Parse the content
Chunk the information
Embed each chunk
Set up the database
Postgres
as both our contents and vector databases.Install docker desktop and run Postgres on port 5532 using:pgvector
extension installed.Do agentic RAG
agentic_rag.py
with the following contentsRun the agent