Skip to main content

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 callAgent only needs it for specific questions
You want zero retrieval latencyYou need broad coverage across many topics
Examples: pricing table, business hours, return policyExamples: product catalog, full FAQ library, support docs
Not sure? Start with RAG. It’s safer for most use cases. Switch to Context only for small, always-needed content.

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:
System Prompt:
You are a helpful customer service agent.

[Your agent instructions...]

==== KNOWLEDGE BASE: Customer Support FAQ ====

### Billing & Payments
- Question: How do I update my payment method?
  Answer: You can update your payment method by...

- Question: When will I be billed?
  Answer: Billing occurs on the same day each month...

### Return Policy
[Full return policy content]

### Shipping Information
[Full shipping information]

==== END KNOWLEDGE BASE ====

Now assist the customer with their question.
The agent sees ALL knowledge content from the start and can reference it throughout the conversation.

Formatted Output

By default, the system injects knowledge with structured formatting:
========================================
# Knowledge Base Name
Knowledge base description

## Folder Name
Folder description

### Item Title
----------------------------------------
Item content here
----------------------------------------
========================================
This formatting helps the agent understand the structure and organization of the knowledge.

When to Use Context Mode

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
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)
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

Context Mode is limited to 10,000 tokens (roughly 7,500 words) total across all assigned knowledge.
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:
  1. User asks a question: “What’s your return policy?”
  2. Agent identifies need: Agent determines it needs knowledge about returns
  3. System searches: RAG system searches knowledge base for relevant content
  4. Relevant content retrieved: Only the return policy section is fetched
  5. Agent responds: Agent uses retrieved knowledge to answer
The agent only sees the knowledge it needs, when it needs it.

Intelligent Retrieval

RAG uses semantic search with vector embeddings to find relevant knowledge:
User: "I need to send back the shoes I bought last week"

RAG System thinks:
- Keywords: "send back", "shoes", "bought"
- Semantic meaning: Returns, possibly exchange
- Search knowledge for: return policy, shipping, exchanges

Retrieved knowledge:
- Return Policy Overview
- Return Shipping Instructions
- Exchange Procedures

NOT retrieved:
- Billing FAQ
- Product Specifications
- Account Management

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.
Retrieval quality depends on:
  • 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)
This combines the strengths of both methods.

Testing Your Configuration

1

Assign knowledge base

Configure your agent with a knowledge base in either Context or RAG Mode.
2

Start a test

Use the Test Agent menu to start a chat, web call, or phone call.
3

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?”
4

Verify responses

Confirm the agent is correctly using knowledge content in responses.
5

Test edge cases

Ask about topics NOT in your knowledge base to ensure agent responds appropriately (“I don’t have that information”).

Best Practices

When in doubt, use RAG Mode. It’s safer for large knowledge bases and you can always switch to Context Mode if needed.
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
Try both Context and RAG Mode with your knowledge base and see which performs better for your use case.
Use Context Mode for critical, frequently-needed info and RAG Mode for extensive reference material.

Troubleshooting

Check:
  • Do all knowledge items show green (ready to use)?
  • Is remaining context sufficient (not truncated)?
Solution:
  • Fix failed items
  • Reduce knowledge size or switch to RAG
Check:
  • Is content well-organized?
  • Are you asking questions that match the knowledge?
Solution:
  • Add more detailed content
  • Test with different phrasings
  • Consider adding keywords to content
Check:
  • Is the knowledge content correct and current?
  • Do you have conflicting information in multiple items?
Solution:
  • Update knowledge content
  • Remove duplicates and conflicts
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