Knowledge Base

Connect document collections to your agents for context-aware, accurate responses using Retrieval-Augmented Generation (RAG) technology.

app.8bit-ai.com
Knowledge Base page

Easy Upload

Upload PDFs, DOC, TXT, MD, and more. Automatic processing and indexing.

Smart Retrieval

Vector embeddings and semantic search for relevant context retrieval.

Version Control

Update documents without breaking agent functionality. Track changes over time.

Multi-Agent

Share knowledge bases across multiple agents. Single source of truth.

Understanding RAG (Retrieval-Augmented Generation)

A knowledge base is a collection of documents that provides your agents with domain-specific information through Retrieval-Augmented Generation (RAG). RAG combines the power of large language models with your proprietary data, enabling agents to provide accurate, contextual responses grounded in your documentation.

How RAG Works

When a user asks a question, the RAG system follows this pipeline:

  1. 1

    Query Embedding

    The user's question is converted into a high-dimensional vector using the same embedding model used for your documents (e.g., OpenAI text-embedding-3, Cohere embed-v3)

  2. 2

    Semantic Search

    Vector database performs cosine similarity search to find the most relevant document chunks. Results are ranked by similarity score (0-1 range).

  3. 3

    Context Assembly

    Top-ranked chunks (typically 3-5) are retrieved and assembled into a context window, along with metadata like source document and relevance score.

  4. 4

    Augmented Prompt

    Retrieved context is injected into the system prompt along with instructions to ground the response in the provided information and cite sources.

  5. 5

    Response Generation

    The LLM generates a response using both its pre-trained knowledge and the specific context from your documents, ensuring accuracy and relevance.

Supported Document Types

FormatExtensionsNotes
PDF.pdfText extraction, preserves structure
Word.doc, .docxFull formatting support
Plain Text.txtSimple, fast processing
Markdown.mdPreserves headings and structure
HTML.html, .htmWeb pages and articles
CSV.csvStructured data, tables

Creating a Knowledge Base

Getting Started

Navigate to Knowledge Base → Create Collection in your dashboard to begin.

1. Create a Collection

Give your knowledge base a descriptive name and optional description.

2. Upload Documents

Upload documents through the API or dashboard. Multiple sources supported: files, URLs, or raw text.

Maximum file size: 50MB per document. Maximum 1000 documents per knowledge base.

3. Processing & Indexing

Documents are automatically processed through our indexing pipeline:

  • Parsed and text extracted
  • Split into optimal chunk sizes (typically 500-1000 tokens)
  • Converted to vector embeddings using state-of-the-art models
  • Indexed in vector database for fast semantic search

Processing time depends on document size. Most documents process in under a minute. Large documents may take several minutes.

4. Connect to Agents

Link knowledge bases to your agents to enable RAG-powered responses.

How Agents Use Knowledge

Understanding how your agents leverage knowledge bases helps optimize their performance.

Conversation Flow with RAG

1

User Message Received

"How do I integrate your API with my React app?"

2

Knowledge Base Query

System searches linked knowledge bases for relevant documentation about API integration and React

3

Context Retrieved

Top 3-5 relevant chunks pulled: installation guide, authentication setup, React SDK examples

4

Prompt Augmentation

System prompt + retrieved context + conversation history assembled for LLM

5

Agent Response Generated

"Here's how to integrate our API with React: [detailed steps from docs with citations]"

Transparent Citations

Agents can be configured to include source citations in their responses, helping users verify information and explore documentation further. This builds trust and enables self-service learning.

RAG Configuration

Fine-tune how your agent retrieves and uses knowledge base content.

Max Chunks

Number of document chunks to retrieve per query (1-10). More chunks = more context but higher token usage and cost.

1-2 chunks:Quick facts, simple queries
3-5 chunks:Balanced approach (recommended)
6-10 chunks:Complex questions requiring broad context

Similarity Threshold

Minimum cosine similarity score (0-1) for including a chunk. Higher = more strict matching, only very relevant content.

0.5-0.6:Loose matching, broad recall
0.7-0.8:Balanced precision/recall (recommended)
0.85-1.0:Very strict, only exact matches

Chunk Size

Size of document chunks in tokens (200-2000). Affects granularity of retrieval.

200-400:Short paragraphs, precise retrieval
500-1000:Medium sections (recommended)
1200-2000:Large sections, more context per chunk

Chunk Overlap

Number of overlapping tokens between consecutive chunks (0-200). Prevents information loss at chunk boundaries.

0:No overlap (may lose context at boundaries)
50-100:Recommended overlap for continuity
150-200:High overlap for narrative content

Embedding Model

The model used to convert text into vector embeddings. Must be consistent for query and document embeddings.

OpenAI text-embedding-3:High quality, broad language support
Cohere embed-v3:Multilingual, compression-friendly

Performance vs. Cost

Higher max chunks and larger chunk sizes improve context quality but increase token usage and LLM costs. Start with recommended defaults and adjust based on your use case and budget.

Querying Knowledge Base

Query your knowledge base programmatically for testing and debugging retrieval quality.

Document Organization Best Practices

Structuring Your Documents

Use Clear Hierarchies

Structure documents with headings (H1, H2, H3) to create clear sections. The chunking algorithm preserves heading context, improving retrieval accuracy.

Optimize Chunk Size

Keep paragraphs focused and concise (3-5 sentences). Each chunk should contain a complete thought or instruction. Avoid mixing multiple topics in a single paragraph.

Include Context in Each Section

Since chunks may be retrieved independently, ensure each section provides enough context. Don't rely heavily on "as mentioned above" references.

Bad:

"Follow the steps above to complete setup."

Good:

"To complete API integration setup, follow these authentication steps."

Collection Strategy

Separate by Domain or Use Case

Create separate collections for distinct knowledge domains:

  • Product Documentation - User guides, feature docs
  • API Reference - Technical specs, endpoints
  • Troubleshooting - Error codes, solutions
  • Company Policies - HR, legal, procedures

Benefits: Better relevance filtering, easier maintenance, cleaner analytics

Version Control Strategy

For versioned documentation, use separate collections per major version or add version identifiers in document titles. Enable/disable older versions as needed.

✓ DO

  • • Use clear, well-structured documents with proper headings
  • • Include descriptive titles and metadata for each document
  • • Keep documents focused on specific topics (one topic per document)
  • • Update documents regularly and re-sync to keep information current
  • • Test retrieval with diverse sample queries before deployment
  • • Use multiple smaller documents rather than one huge file (easier to maintain)
  • • Include examples, code snippets, and step-by-step instructions
  • • Monitor retrieval quality metrics and adjust chunk settings

✗ DON'T

  • • Upload scanned images without OCR (text won't be extractable)
  • • Include duplicate or redundant content across documents
  • • Use extremely large files (split into logical sections instead)
  • • Forget to test retrieval quality after updating documents
  • • Mix unrelated topics in the same knowledge base
  • • Use vague titles like "Document 1" or "Notes"
  • • Include sensitive data (passwords, API keys, PII) in documents
  • • Rely on outdated information (set up regular review cycles)

Example Use Cases

Customer Support

Upload product manuals, FAQs, and troubleshooting guides.

  • • Instant answers to common questions
  • • Accurate product information
  • • Reduced support ticket volume

Internal HR Assistant

Employee handbook, policies, benefits documentation.

  • • 24/7 HR policy access
  • • Consistent policy interpretation
  • • Reduced HR team workload

Sales Enablement

Product specs, pricing, competitive analysis, case studies.

  • • Quick access to sales collateral
  • • Accurate pricing information
  • • Competitive positioning insights

Technical Documentation

API docs, SDK guides, integration tutorials.

  • • Code examples and snippets
  • • API reference lookup
  • • Implementation guidance