Skip to main content
Knowledge gives your agent information it can search at runtime. This pattern is known as Agentic RAG. The agent decides when to search based on the user’s question.
1

Create a Python file

agent_with_knowledge.py
2

Set up your virtual environment

3

Install dependencies

4

Export your OpenAI API key

5

Run Agent

How It Works

  1. Knowledge base: Documents are chunked, embedded, and stored in a vector database
  2. Search: Agent searches the knowledge base using hybrid search (semantic + keyword)
  3. Context: Relevant chunks are added to context before generating a response

Adding Different Content Types