Skip to main content

Knowledge

Enable context-aware responses with RAG-powered retrieval.

Overview

Knowledge connects your agents to your data sources, enabling Retrieval-Augmented Generation (RAG). Instead of relying solely on the LLM’s training data, agents can search your knowledge bases and incorporate relevant information into responses.
User Question → Semantic Search → Retrieve Relevant Chunks → Augment Prompt → Generate Response

How It Works

The RAG Pipeline

┌─────────────────────────────────────────────────────────────────┐
│                        User Query                                │
│            "What's your return policy for electronics?"          │
└───────────────────────────────┬─────────────────────────────────┘


┌─────────────────────────────────────────────────────────────────┐
│                     Query Embedding                              │
│        Convert question to vector representation                 │
└───────────────────────────────┬─────────────────────────────────┘


┌─────────────────────────────────────────────────────────────────┐
│                    Semantic Search                               │
│         Search knowledge base for similar content                │
└───────────────────────────────┬─────────────────────────────────┘


┌─────────────────────────────────────────────────────────────────┐
│                   Chunk Retrieval                                │
│     Return top-k relevant passages from documents                │
└───────────────────────────────┬─────────────────────────────────┘


┌─────────────────────────────────────────────────────────────────┐
│                  Prompt Augmentation                             │
│      Inject retrieved context into agent's prompt                │
└───────────────────────────────┬─────────────────────────────────┘


┌─────────────────────────────────────────────────────────────────┐
│                 Response Generation                              │
│    Agent generates grounded, accurate response                   │
└─────────────────────────────────────────────────────────────────┘

Key Capabilities

Extensive Connectors

Connect to 100+ data sources:
  • Cloud Storage: Google Drive, OneDrive, Dropbox
  • Collaboration: Confluence, SharePoint, Notion
  • Business Apps: Salesforce, Jira, HubSpot
  • Communication: Slack, Microsoft Teams
  • Databases: SQL, NoSQL, custom APIs
  • Hybrid search: Combine keyword and semantic matching
  • Multi-vector: Weight different embedding strategies
  • Programmable extraction: Custom chunking pipelines

Enterprise Security

  • Access control integration
  • Permission-aware retrieval
  • Audit logging

Setting Up Knowledge

Step 1: Create a Search AI Application

  1. Navigate to Knowledge in your app
  2. Click + Connect Knowledge
  3. Select Create new Search AI app or link existing

Step 2: Add Data Sources

Choose your content sources:
sources:
  - type: web_crawler
    url: https://help.yourcompany.com
    depth: 3
    schedule: daily

  - type: confluence
    space: SUPPORT
    credentials: "{{env.CONFLUENCE_TOKEN}}"

  - type: file_upload
    formats: [pdf, docx, txt, md]

Step 3: Configure Ingestion

Set up how content is processed:
ingestion:
  chunking:
    strategy: semantic  # or: fixed, paragraph
    max_chunk_size: 512
    overlap: 50

  embedding:
    model: text-embedding-3-small
    dimensions: 1536
  1. Open your agent configuration
  2. Navigate to Knowledge
  3. Select the Search AI application
  4. Configure retrieval settings

Three-Stage Workflow

1. Ingestion

Bring content into the knowledge base. Methods:
  • Web crawling
  • Directory indexing
  • Third-party connectors
  • File uploads
  • API integrations
Processing:
  • Content extraction
  • Format normalization
  • Metadata enrichment

2. Enhancement & Embedding

Prepare content for semantic search. Chunking: Split documents into searchable segments
┌────────────────────────────────────────┐
│              Full Document              │
└────────────────────────────────────────┘

         ┌──────────┼──────────┐
         ▼          ▼          ▼
    ┌─────────┐ ┌─────────┐ ┌─────────┐
    │ Chunk 1 │ │ Chunk 2 │ │ Chunk 3 │
    └─────────┘ └─────────┘ └─────────┘
Embedding: Convert text to vector representations
"Return policy for electronics" → [0.023, -0.156, 0.891, ...]

3. Retrieval

Fetch relevant content at query time. Strategies:
  • Vector similarity search
  • Hybrid (vector + keyword)
  • Reranking for relevance

Retrieval Configuration

Basic Settings

retrieval:
  strategy: hybrid  # vector, keyword, hybrid
  top_k: 5          # Number of chunks to retrieve
  score_threshold: 0.7  # Minimum relevance score

Advanced Options

retrieval:
  query_processing:
    expansion: true      # Expand query with synonyms
    rewriting: true      # LLM rewrites for better search

  reranking:
    enabled: true
    model: cross-encoder

  filtering:
    metadata:
      category: support
      language: en

Answer Generation

Extractive

Pull exact quotes from source documents.
Question: "What's the return window?"

Retrieved: "Items may be returned within 30 days of purchase."

Answer: "Items may be returned within 30 days of purchase."
        [Source: Return Policy, Section 2.1]

Generative

Synthesize answers using retrieved context.
Question: "Can I return opened electronics?"

Retrieved:
- "Electronics have a 15-day return window."
- "Opened items may be subject to restocking fee."
- "Defective items can be returned within warranty period."

Answer: "Yes, you can return opened electronics within 15 days,
        though a restocking fee may apply. If the item is
        defective, you can return it within the warranty period
        without a fee."

Knowledge in Agent Prompts

Retrieved knowledge is injected into agent context:
## Retrieved Context

The following information was retrieved from the knowledge base
and is relevant to the user's question:

---
**Source**: Return Policy (updated: 2024-01-15)

Electronics have a 15-day return window from date of purchase.
Opened items are subject to a 15% restocking fee unless defective.
Original packaging must be included for full refund.

---

Use this context to answer the user's question accurately.
Only provide information that is supported by the retrieved context.

Best Practices

Quality Content

  • Keep documentation up-to-date
  • Use clear, structured writing
  • Include relevant metadata

Appropriate Chunking

Content TypeStrategyChunk Size
FAQsQuestion-answer pairsSmall (200-300 tokens)
DocumentationSections/headersMedium (400-600 tokens)
Long articlesSemantic breaksVariable

Retrieval Tuning

  • Start with top_k=5, adjust based on results
  • Use score thresholds to filter low-quality matches
  • Enable reranking for better precision

Grounding Instructions

Tell agents how to use knowledge:
Instructions:
- Base your answers on the retrieved knowledge
- If the answer isn't in the knowledge base, say so
- Cite sources when providing specific information
- Don't make up information not present in the context

Monitoring

Track knowledge retrieval performance:
  • Hit rate: How often relevant content is found
  • Latency: Search response times
  • Relevance: User satisfaction with answers
  • Coverage: Questions without good matches