Skip to main content

Overview

Knowledge Bases in OrbitAI enable agents to access and retrieve information from external documents and data sources. Using Retrieval Augmented Generation (RAG), agents can ground their responses in factual information, answer questions about specific domains, and provide accurate, contextual assistance based on your organization’s knowledge.

RAG-Enabled

Retrieval Augmented Generation for grounded responses

Multi-Format

Support for PDF, Markdown, JSON, and text documents

Semantic Search

Embedding-based retrieval finds relevant information

Automatic

Agents automatically query knowledge during execution

Scalable

Handle large document collections efficiently

Dynamic

Add or update knowledge sources at runtime

Key Capabilities

RAG combines the power of LLMs with factual information from your knowledge base. Agents automatically retrieve relevant context from documents and use it to generate accurate, grounded responses.
Using vector embeddings, the knowledge base performs semantic search to find relevant information even when queries don’t exactly match document text. This enables natural language queries over your documents.
When agents execute tasks, relevant knowledge is automatically retrieved and injected into the LLM context, requiring no manual intervention or query operations.
Agents can synthesize information from multiple documents simultaneously, creating comprehensive answers that draw from your entire knowledge base.

How Knowledge Bases Work

RAG Architecture

Embedding-Based Retrieval

Knowledge bases use vector embeddings to enable semantic search:
Step 1: Document Processing
Step 2: Query Processing
Step 3: Retrieval

System Integration

Knowledge retrieval happens automatically during agent execution. You don’t need to manually query the knowledge base—agents do it for you based on task requirements.

Configuration and Usage

Basic Configuration

Add knowledge sources to agents or orbits using simple file paths:

Agent-Level Knowledge Base

Configure knowledge bases for individual agents:
1

Define Knowledge Sources

Specify document paths when creating the agent:
2

Create Tasks

Create tasks that leverage the knowledge base:
3

Execute

Run the orbit—knowledge is automatically queried:

Orbit-Level Knowledge Base

Share knowledge across all agents in an orbit:
Agent-level knowledge base:
  • Agents need different domain knowledge
  • Specialized agents with unique document sets
  • Fine-grained control over knowledge access
  • Separate knowledge bases per role
Orbit-level knowledge base:
  • All agents need same knowledge
  • Collaborative workflows
  • Shared company knowledge
  • Simplified configuration
Example:

Dynamic Knowledge Sources

Add knowledge sources dynamically after creation:
Use Cases:
  • Loading documents based on user input
  • Adding knowledge as it becomes available
  • A/B testing different knowledge sources
  • Incremental knowledge base building

Knowledge Sources

OrbitAI supports multiple document formats for knowledge ingestion:

Supported File Formats

PDF Documents

Format: .pdf Use Cases: Manuals, reports, research papers, books Features:
  • Text extraction from pages
  • Metadata preservation
  • Table detection
  • Multi-page support
Example:

Markdown Files

Format: .md, .mdx Use Cases: Documentation, wikis, README files Features:
  • Native markdown parsing
  • Header hierarchy preservation
  • Code block handling
  • Link resolution
Example:

JSON Data

Format: .json Use Cases: Structured data, catalogs, configuration Features:
  • Structured data parsing
  • Nested object handling
  • Array processing
  • Schema-aware search
Example:

Plain Text

Format: .txt Use Cases: FAQs, notes, transcripts, logs Features:
  • Simple text ingestion
  • Fast processing
  • No formatting overhead
  • Universal compatibility
Example:

File Path Specifications

Knowledge sources accept various path formats:
Relative to current working directory:
Best for: Project-relative documents

Document Organization

Organize knowledge sources for optimal retrieval:
Organization Best Practice: Use a clear directory structure that mirrors your knowledge domains. This makes maintenance easier and helps with debugging retrieval issues.

Knowledge Source Examples

Medical Disclaimer: Healthcare applications require careful validation and should not replace professional medical advice. Always ensure compliance with healthcare regulations (HIPAA, etc.).

Integration Patterns

Knowledge Base + Memory

Combine knowledge bases with memory systems for powerful agents:
How it works:

Knowledge Base + Tools

Combine knowledge bases with tools for action-oriented agents:
Agent workflow:
  1. Query knowledge base: Find John’s email in contacts
  2. Query knowledge base: Check meeting policies for defaults
  3. Use tool: Send email to John
  4. Use tool: Create calendar event
  5. Return: Confirmation with details

Knowledge Base Access in Tasks

Access knowledge base programmatically in custom tasks:

Best Practices

Document Preparation

Clean Documents

Prepare documents for optimal retrieval:Do:
  • Remove unnecessary formatting
  • Use clear headings and structure
  • Include relevant metadata
  • Keep content focused
Don’t:
  • Include excessive boilerplate
  • Use unclear abbreviations
  • Mix unrelated topics
  • Keep outdated information

Chunk-Friendly Content

Structure content for effective chunking:Good structure:
Poor structure:

Rich Metadata

Include metadata for better retrieval:PDF: Use title, author, subject fields Markdown: Include frontmatter
JSON: Structure with metadata

Document Size

Optimal document sizing:Too small: < 1 page
  • Merge related documents
  • Create topic-based documents
Optimal: 5-50 pages
  • Good chunk coverage
  • Manageable retrieval
Too large: > 100 pages
  • Split into logical sections
  • Create separate documents per topic

Knowledge Base Architecture

< 10 documents
Characteristics:
  • Single agent with all knowledge
  • Flat file structure
  • No complex organization needed

Retrieval Optimization

Adjust thresholds based on retrieval quality:
Testing approach:
Retrieve optimal number of results:
Guidelines:
  • Quick answers: 3-5 results
  • Comprehensive analysis: 5-10 results
  • Research tasks: 10-20 results
  • Monitor context window: Don’t exceed LLM limits
Formulate effective queries:Poor queries:
Good queries:
Best practice:
Cache frequently accessed knowledge:

Production Best Practices

Version Control

Track knowledge base changes:
Benefits:
  • Track document changes
  • Rollback if needed
  • Coordinate with code releases

Validation

Validate knowledge base setup:

Monitoring

Monitor knowledge base usage:

Documentation

Document your knowledge base:

Troubleshooting

Common Issues

Symptom: Agent can’t access knowledge base or documents not found.Causes:
  • Invalid file paths
  • Missing files
  • Permission issues
  • Unsupported file format
Diagnosis:
Solutions:
Symptom: Irrelevant results or missing relevant information.Causes:
  • Threshold too high or too low
  • Poor embedding model
  • Document quality issues
  • Query formulation problems
  • Insufficient knowledge coverage
Diagnosis:
Solutions:
Symptom: Knowledge queries take too long.Causes:
  • Large knowledge base
  • Expensive embedding generation
  • No caching
  • Inefficient vector search
  • Network latency (remote embeddings)
Diagnosis:
Solutions:
Symptom: Updated documents not reflected in retrieval.Causes:
  • Cache not invalidated
  • Index not refreshed
  • Using old orbit instance
  • Documents not reprocessed
Diagnosis:
Solutions:
Symptom: Application crashes or memory errors when loading knowledge base.Causes:
  • Too many documents
  • Documents too large
  • All documents loaded at once
  • Embeddings cached in memory
Diagnosis:
Solutions:

Debugging Knowledge Bases

Create debugging utilities for knowledge base inspection:

Advanced Configuration

Knowledge Base Configuration Object

For advanced use cases, configure knowledge base behavior with KnowledgeConfiguration:

Chunking Strategies

Different chunking strategies for different document types:
Best for: General documents, mixed content
Pros:
  • Predictable chunk sizes
  • Simple implementation
  • Works for most documents
Cons:
  • May split mid-sentence
  • Doesn’t respect structure

Vector Store Options

Choose the appropriate vector storage backend:

In-Memory Store

Best for: Development, small knowledge bases
Characteristics:
  • ✅ Fast retrieval
  • ✅ No setup required
  • ✅ Simple debugging
  • ❌ Lost on restart
  • ❌ Memory limited
  • ❌ Single instance only
Recommended: < 1000 documents

Persistent Store

Best for: Production, medium knowledge bases
Characteristics:
  • ✅ Survives restarts
  • ✅ Reasonable performance
  • ✅ No external dependencies
  • ❌ Slower than in-memory
  • ❌ Limited scalability
Recommended: 1000-10,000 documents

Pinecone

Best for: Large-scale production
Characteristics:
  • ✅ Massive scalability
  • ✅ Fast at any scale
  • ✅ Managed service
  • ❌ External dependency
  • ❌ Additional cost
Recommended: 10,000+ documents

Custom Backend

Best for: Specialized requirements
Use cases:
  • Integration with existing systems
  • Specialized search algorithms
  • Custom security requirements

Metadata Extraction and Filtering

Extract and use metadata for enhanced retrieval:

Reranking Strategies

Improve retrieval quality with reranking:
Speed: Fastest Quality: Good
Vector similarity only

Performance Optimization

Optimization Checklist

1

Optimize Chunk Size

Test different chunk sizes for your content:
Guidelines:
  • Small (256-512): Precise retrieval, technical docs
  • Medium (512-1024): Balanced, general use
  • Large (1024-2048): Broader context, narratives
2

Tune Retrieval Parameters

Optimize retrieval for your use case:
Performance tips:
  • Lower retrievalLimit = faster, may miss information
  • Higher similarityThreshold = fewer but better results
  • Enable reranking for quality, disable for speed
3

Implement Caching

Cache frequently accessed queries:
Cache strategies:
  • LRU: Good for varied queries
  • LFU: Good for repeated queries
  • TTL: Good for time-sensitive data
4

Choose Efficient Embedding Model

Balance quality vs. performance:
5

Batch Processing

Process documents in batches:
6

Lazy Loading

Load documents on-demand:

Performance Benchmarking

Benchmark your knowledge base setup:

Security and Privacy

Sensitive Data Handling

Implement safeguards for sensitive information:

Access Control

Implement role-based access to knowledge:

Encryption

Encrypt knowledge base storage:

Audit Logging

Track knowledge base access:

Real-World Examples

Example 1: Customer Support Bot

Complete implementation of a knowledge-powered support system:
RAG-powered legal research assistant:

Example 3: Medical Information System

HIPAA-compliant medical knowledge system:
Medical Applications: Healthcare applications must comply with regulations (HIPAA, GDPR, etc.). This example is for educational purposes. Consult legal and compliance experts before deploying medical AI systems.

Migration and Maintenance

Migrating Existing Knowledge

Migrate from other RAG systems to OrbitAI:

Knowledge Base Versioning

Version your knowledge base for rollback capability:

Maintenance Operations

Regular maintenance for optimal performance:

Next Steps

Memory Systems

Learn about memory systems for dynamic knowledge

Agent Configuration

Configure agents with knowledge bases

Tools

Combine knowledge with tools for action-oriented agents

Orbit Workflows

Orchestrate knowledge-powered agent workflows

Pro Tip: Start with a small, well-organized knowledge base (5-10 essential documents) and expand based on retrieval gaps. Monitor which queries return poor results and add targeted documents to fill those gaps.