Key Terminology
Knowledge Base
A structured repository of information that agents can search and retrieve from at runtime. Contains processed content optimized for AI understanding and retrieval.Agentic RAG
Retrieval Augmented Generation where the agent actively decides when to search, what to search for, and how to use the retrieved information. Unlike traditional RAG systems, the agent has full control over the search process.Vector Embeddings
Mathematical representations of text that capture semantic meaning. Words and phrases with similar meanings have similar embeddings, enabling intelligent search beyond keyword matching.Chunking
The process of breaking large documents into smaller, manageable pieces that are optimal for search and retrieval while preserving context.Dynamic Few-Shot Learning
The pattern where agents retrieve specific examples or context at runtime to improve their performance on tasks, rather than having all information provided upfront.Example: Dynamic Few-Shot Learning in Action
Example: Dynamic Few-Shot Learning in Action
Scenario: Building a Text-to-SQL AgentInstead of cramming all table schemas, column names, and example queries into the system prompt, you store this information in a knowledge base.When a user asks for data, the agent:
- Analyzes the request
- Searches for relevant schema information and example queries
- Uses the retrieved context to generate the best possible SQL query
Core Knowledge Components
Content Sources
The raw information you want your agents to access:- Documents: PDFs, Word files, text files
- Websites: URLs, web pages, documentation sites
- Databases: SQL databases, APIs, structured data
- Text: Direct text content, notes, policies
Readers
Specialized components that parse different content types and extract meaningful text:- PDFReader: Extracts text from PDF files, handles encryption
- WebsiteReader: Crawls web pages and extracts content
- CSVReader: Processes tabular data from CSV files
- Custom Readers: Build your own for specialized data sources
Chunking Strategies
Methods for breaking content into optimal pieces:- Semantic Chunking: Respects natural content boundaries
- Fixed Size: Uniform chunk sizes with overlap
- Document Chunking: Preserves document structure
- Recursive Chunking: Hierarchical splitting with multiple separators
Vector Databases
Storage systems optimized for similarity search:- PgVector: PostgreSQL extension for vector storage
- LanceDB: Fast, embedded vector database
- Pinecone: Managed vector database service
- Qdrant: High-performance vector search engine