> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fife.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> How FIFE.BOT's knowledge base works — source types, processing pipeline, and how your chatbot retrieves answers.

The knowledge base is what makes your chatbot smart. It contains all the content your chatbot can reference when answering questions. Without a knowledge base, your chatbot only has the AI model's general knowledge.

## How It Works

<Steps>
  <Step title="You add content">
    Upload documents, scrape websites, connect integrations, or type text manually.
  </Step>

  <Step title="FIFE.BOT processes it">
    Content is split into chunks, converted to vector embeddings (using OpenAI's text-embedding-3-large), and stored in a PostgreSQL database with pgvector.
  </Step>

  <Step title="User asks a question">
    The question is analyzed, decomposed into sub-queries if needed, and searched against the knowledge base using **hybrid search** — combining vector similarity and full-text search.
  </Step>

  <Step title="Best chunks are retrieved">
    Results are fused, deduplicated, diversified by source, reranked by the LLM, and checked for coverage. If coverage is insufficient, additional retrieval rounds run automatically.
  </Step>

  <Step title="AI generates a response">
    The selected chunks are passed as context to the AI model, which generates a grounded response with source citations.
  </Step>
</Steps>

## Source Types

| Source                    | Description                                  | Auto-Sync             |
| ------------------------- | -------------------------------------------- | --------------------- |
| **Websites**              | Crawl and index web pages via Firecrawl      | Yes (scheduled)       |
| **Documents**             | Upload PDF, DOCX, TXT files                  | No (manual re-upload) |
| **Texts**                 | Write or paste content in a rich text editor | No (manual edit)      |
| **Q\&A Tables**           | Structured question-answer pairs             | No (manual edit)      |
| **Notion**                | Sync pages from Notion workspaces            | Yes (scheduled)       |
| **Confluence**            | Sync pages from Confluence spaces            | Yes (scheduled)       |
| **Google Drive**          | Sync files from Google Drive folders         | Yes (scheduled)       |
| **SharePoint / OneDrive** | Sync documents from Microsoft 365            | Yes (scheduled)       |

## The Knowledge Base Tab

Open any chatbot and click the **Knowledge Base** tab to see:

* **Add Source** dropdown — pick a source type to add
* **Filter bar** — filter by source type (All, Websites, Documents, Texts, Table, Notion, Confluence, Google Drive, SharePoint)
* **Source list** — all added sources with status indicators
* **Processing stats** — total sources, ready count, processing count

### Source Status Indicators

| Status         | Meaning                                                  |
| -------------- | -------------------------------------------------------- |
| **Ready**      | Content is indexed and searchable                        |
| **Processing** | Content is being chunked and embedded                    |
| **Error**      | Processing failed — click to see error details and retry |

### Per-Source Actions

| Action     | Description                                         |
| ---------- | --------------------------------------------------- |
| **Delete** | Remove the source and all its chunks                |
| **Resync** | Re-fetch and re-process content (integrations only) |
| **Edit**   | Modify content (texts and Q\&A tables only)         |
| **Rename** | Change the display name                             |

## Routing Instructions

Each knowledge base source can have optional **routing instructions** — extra context that tells the AI how to use content from that specific source.

**Example:** A website source for your pricing page might have routing instructions like:

> "When answering pricing questions from this source, always mention the 14-day free trial and the annual discount."

Routing instructions are combined with the system prompt at query time.

## Plan Limits

Limits match [fife.bot](https://www.fife.bot) pricing — your plan caps **chatbots**, **monthly credits**, and **knowledge sources** (each website, document set, integration, etc. counts as a source).

| Resource          | Free | Pro   | Business  |
| ----------------- | ---- | ----- | --------- |
| Chatbots          | 1    | 5     | 10        |
| Credits/month     | 50   | 2,000 | 5,000     |
| Knowledge sources | 1    | 10    | Unlimited |

## Search Technology

FIFE.BOT uses a sophisticated retrieval pipeline:

1. **Query analysis** — determines intent, language, and complexity
2. **Multi-query decomposition** — complex questions are split into sub-queries
3. **Hybrid search** — vector cosine similarity + PostgreSQL full-text search with weighted scoring
4. **Reciprocal Rank Fusion** — merges results from multiple search strategies
5. **Source diversification** — ensures results come from multiple sources
6. **Parent chunk expansion** — retrieves surrounding context for better answers
7. **LLM reranking** — the AI re-scores chunks for relevance
8. **Coverage checking** — if the answer isn't fully covered, additional retrieval rounds run

This means your chatbot doesn't just do keyword matching — it understands the meaning of questions and finds the most relevant content, even if the exact words don't appear in your documents.
