Two Access Methods
When you assign knowledge to your agent, you need to choose how the agent accesses that information. If you have not created a knowledge base yet, start with the create knowledge bases guide. itellicoAI offers two access methods: Context Mode (prompt injection) and RAG Mode (RAG: Retrieval-Augmented Generation — a search system that finds only the most relevant information your agent needs).Quick Decision
| Use Context When… | Use RAG When… |
|---|---|
| Content is small (under a few thousand words) | Content is large (FAQs, catalogs, full documentation) |
| Agent needs it on every single call | Agent only needs it for specific questions |
| You want zero retrieval latency | You need broad coverage across many topics |
| Examples: pricing table, business hours, return policy | Examples: product catalog, full FAQ library, support docs |
The Two Access Methods
Context Mode
Prompt InjectionAll knowledge is injected directly into the agent’s conversation context (alongside your prompt) at the start of each interaction.Best for: Small knowledge bases with critical information the agent needs for every conversation.
RAG Mode
RAG (Retrieval-Augmented Generation)Agent dynamically searches and retrieves relevant knowledge based on the conversation topic.Best for: Larger knowledge bases where only specific sections are needed per conversation.
Context Mode (Prompt Injection)
How It Works
In Context Mode, the platform loads your knowledge base content directly into the agent’s system prompt at the beginning of each conversation:Formatted Output
By default, the system injects knowledge with structured formatting:When to Use Context Mode
Small, high-priority knowledge
Small, high-priority knowledge
If your content is compact and the agent needs it on every call, Context Mode ensures it’s always available.Example use case:
A support agent with a knowledge base containing:
- 10 common FAQs
- Return policy
- Contact information
- Shipping options
Critical information needed every time
Critical information needed every time
Information the agent must reference on most or all calls.Example use case:
A booking agent that needs:
- Company policies (always)
- Available services (always)
- Pricing structure (always)
- Booking procedures (always)
Highly structured information
Highly structured information
When knowledge items reference each other or form a cohesive whole.Example use case:
Product configuration agent with:
- Option dependencies (“If they choose X, offer Y”)
- Compatibility matrix
- Package bundles
- Pricing that depends on combinations
Context Mode Advantages
Always Available
Access all knowledge immediately without search delay
Better for Small Sets
Handle small knowledge sets efficiently within the context window
Deterministic
Deliver exactly the same knowledge every time
Works with Variables
Include Jinja variables that resolve at runtime
Context Mode Limitations
Trade-offs:- All context-mode content is sent with every request, so more content means higher cost and latency
- The entire knowledge base is included even if only a small portion is relevant for that call
- Best for content that’s a few thousand words or less — use RAG for anything larger
RAG Mode (Retrieval-Augmented Generation)
How It Works
In RAG Mode, the platform stores your knowledge base in a vector database. When the agent needs information:- User asks a question: “What’s your return policy?”
- Agent identifies need: Agent determines it needs knowledge about returns
- System searches: RAG system searches knowledge base for relevant content
- Relevant content retrieved: Only the return policy section is fetched
- Agent responds: Agent uses retrieved knowledge to answer
Intelligent Retrieval
RAG uses semantic search with vector embeddings to find relevant knowledge:RAG Mode Advantages
Scales Beyond Context
Support larger knowledge bases without the 10,000-token context limit
Faster for Large Knowledge
Reduces system prompt tokens for large knowledge bases
Efficient
Only retrieves what’s needed for current topic
Better for Diversity
Handles wide variety of unrelated topics well
RAG Mode Considerations
RAG relies on search accuracy. If your knowledge items aren’t clearly written, retrieval may miss relevant information.
- Clear, descriptive knowledge item titles
- Well-structured content
- Proper categorization into folders
- Avoiding duplicate or conflicting information
Choosing the Right Mode
Use this decision guide to select the best access method:Hybrid Approach
You can use both modes for different knowledge bases on the same agent: Example configuration:- Context Mode: Small “Core Policies” knowledge base (always needed)
- RAG Mode: Large “Product Catalog” knowledge base (retrieve as needed)
Testing Your Configuration
Ask about knowledge content
Ask questions that should be answered from your knowledge base.Example questions:
- “What’s your return policy?”
- “How much does the Pro plan cost?”
- “What are your business hours?”
Best Practices
Start with RAG for large bases
Start with RAG for large bases
When in doubt, use RAG Mode. It’s safer for large knowledge bases and you can always switch to Context Mode if needed.
Write clear, complete content
Write clear, complete content
RAG uses semantic search to find relevant knowledge. Write complete, well-written content that naturally includes the terms and concepts users will ask about.Good: “Our return policy allows returns within 30 days of purchase for physical products. Digital products cannot be returned once downloaded.”Bad: “See policy doc” or incomplete sentence fragments
Test both modes
Test both modes
Try both Context and RAG Mode with your knowledge base and see which performs better for your use case.
Combine strategically
Combine strategically
Use Context Mode for critical, frequently-needed info and RAG Mode for extensive reference material.
Troubleshooting
Agent isn't using knowledge (Context Mode)
Agent isn't using knowledge (Context Mode)
Check:
- Do all knowledge items show green (ready to use)?
- Is remaining context sufficient (not truncated)?
- Fix failed items
- Reduce knowledge size or switch to RAG
Agent isn't finding knowledge (RAG Mode)
Agent isn't finding knowledge (RAG Mode)
Check:
- Is content well-organized?
- Are you asking questions that match the knowledge?
- Add more detailed content
- Test with different phrasings
- Consider adding keywords to content
Agent provides wrong or outdated information
Agent provides wrong or outdated information
Check:
- Is the knowledge content correct and current?
- Do you have conflicting information in multiple items?
- Update knowledge content
- Remove duplicates and conflicts
Context usage too high
Context usage too high
Solutions:
- Switch to RAG Mode for large knowledge bases
- Split knowledge into smaller, focused bases
- Reduce agent prompt length
- Remove verbose or redundant content
Next Steps
Create Knowledge Bases
Build and organize your knowledge content
Content Types
Learn about text, file, URL, and website crawl items
Template Syntax
Use knowledge references in your prompt
Test Your Agent
Test how your agent uses knowledge