Overview
When you assign knowledge to your agent, you need to choose how the agent accesses that information. itellicoAI offers two access methods: Context Mode (prompt injection) and RAG Mode (Retrieval-Augmented Generation). Understanding the difference between these approaches will help you optimize your agent’s performance and accuracy.The Two Access Methods
Context Mode
Prompt InjectionAll knowledge is injected directly into the agent’s conversation context at the start of each interaction.Best for: Small knowledge bases with critical information the agent needs for every conversation.
RAG Mode
Retrieval-Augmented GenerationAgent dynamically searches and retrieves relevant knowledge based on the conversation topic.Best for: Large knowledge bases where only specific sections are needed per conversation.
Context Mode (Prompt Injection)
How It Works
In Context Mode, your knowledge base content is loaded directly into the agent’s system prompt at the beginning of each conversation:Formatted Output
By default, knowledge is injected with structured formatting:When to Use Context Mode
Small knowledge bases (< 1,000 words)
Small knowledge bases (< 1,000 words)
If your knowledge base is compact, Context Mode ensures the agent always has full context.Example use case:
A support agent with a knowledge base containing:
- 10 common FAQs
- Return policy (500 words)
- 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
Agent has immediate access to all knowledge without search delay
Better for Small Sets
Efficient when knowledge fits comfortably in context window
Deterministic
Agent sees exactly the same knowledge every time
Works with Variables
Knowledge can include Jinja variables that resolve in context
Context Mode Limitations
Limitations:- Keep knowledge bases small (< 1,000 words)
- All knowledge is sent with every request (higher cost)
- All knowledge is processed every time (higher latency)
- Entire knowledge base is included even if only a small portion is relevant
RAG Mode (Retrieval-Augmented Generation)
How It Works
In RAG Mode, your knowledge base is stored 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 Infinitely
Support massive knowledge bases without context limits
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 vector embedding quality. 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
Remaining Context Tokens Indicator
When using Context Mode, monitor your remaining context tokens to ensure you have enough room for conversations.Understanding the Indicator
The dashboard shows your context usage in the Knowledge settings:

- RAG Mode: Dynamic vector search with unlimited knowledge size
- Context Mode: Added to system prompt with a 10,000 token limit
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:
- Are all knowledge items in COMPLETED status?
- 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 instruction length
- Remove verbose or redundant content