> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.elacity.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.elacity.ai/_mcp/server.

# Knowledge Bases

A **knowledge base** is a collection of documents that your agents can search at runtime. Instead of stuffing facts into a prompt — where they go stale and bloat every request — you upload them once, Elacity indexes them, and your agents retrieve only the passages they need, exactly when they need them.

Add many documents to a single base. Each one is chunked and vectorized for semantic search.

Attach one or more knowledge bases to an agent to shape exactly what it knows.

Agents search their bases on demand and ground responses in your content.

## Multiple documents in one base

A knowledge base groups related documents together. Upload files (or create documents inline), and Elacity splits each one into smaller, overlapping **chunks** and converts them into vector embeddings. When an agent asks a question, the most semantically relevant chunks across *all* documents in the base are returned — not whole files — so retrieval stays focused and cheap.

This means you can keep a topic's knowledge in one place — a product FAQ, a policy handbook, a set of release notes — and let the agent search the whole collection at once.

Documents are indexed asynchronously after upload. A base is ready to search once its documents finish indexing.

## Connecting bases to your agents

A knowledge base does nothing on its own — it becomes useful when you **link it to an agent**. Each agent keeps a list of the knowledge bases it can draw from, referenced by the base's immutable slug. Once linked, the agent can pull from that knowledge whenever it needs an answer during a conversation.

Because bases are referenced by slug rather than copied, you can update a base's documents at any time and every agent linked to it picks up the new content — no need to touch the agent or redeploy it just to refresh knowledge.

## Layering multiple bases per agent

An agent can reference **several knowledge bases at once**. This lets you compose an agent's knowledge from independent, reusable pieces rather than one monolithic base:

* Share a common base (e.g. company policies) across many agents.
* Add a specialized base (e.g. a product line's docs) to just the agents that need it.
* Swap or layer bases per agent to tune its expertise without rewriting documents.

Think of each base as a layer of knowledge you can mix and match. Two agents can share most of their knowledge while differing in one specialized area, simply by linking a different combination of bases.

## Deploying knowledge with your agent

When you deploy an agent, its linked knowledge bases travel with it. Elacity resolves every base the agent references, validates that each one exists, and wires the agent up so it can search them at runtime.

This happens at a **provider-agnostic** level: the same knowledge-base setup is applied as part of the normal deployment flow, so you configure knowledge once and it works consistently across the runtimes Elacity supports. You don't manage embeddings, vector stores, or retrieval infrastructure yourself — Elacity handles indexing and serving behind the scenes.

## Using knowledge bases as tools

At runtime, agents don't receive your documents as a giant block of context. Instead, knowledge bases are exposed as **tools** the agent can call:

* **List** the knowledge bases available to it.
* **Search** a specific base with a natural-language query and get back the most relevant passages.

This retrieval-as-a-tool design keeps prompts small and responses grounded: the agent decides when a question needs supporting facts, searches the right base on demand, and cites what it finds. The same mechanism powers knowledge lookups in chat interfaces — the assistant calls the search tool mid-conversation and folds the results into its answer.

## Next steps

Deploy an agent with its linked knowledge bases

Manage knowledge bases programmatically