EgoXDocs
Tools & Knowledge

Knowledge Base (RAG)

Add documents your AI can retrieve from — how content is chunked, embedded, and queried per request, plus tags, statuses, and management.

The Knowledge Base is the set of documents your AI can retrieve from to ground its answers — policies, product docs, FAQs, guides. Uploaded content is chunked, embedded, and queried per request (retrieval-augmented generation, or RAG). In the API and MCP these are RAG Documents.

Recommended: let an agent build your knowledge base

Connect the EgoX MCP and ask your agent: "Create a knowledge-base entry titled RefundPolicy from the contents of docs/refund-policy.md." The agent pulls the content straight from your repo or docs and upserts it — no copy-pasting, and it can seed many documents at once. We think building your knowledge base with an agent is the better way; entries it creates arrive as reviewable drafts in the Console.

Add a document

In the Console: Project → Knowledge → Upload.

FieldWhat it is
TitleA name for the document (min 2 chars). Also the identifier used to upsert it over the API/MCP.
ContentThe text itself — paste it in (min 10 chars). It's stored and rendered as Markdown.
TagsOptional, comma-separated (e.g. docs, product, faq). Used to scope retrieval — see below.

How it's processed

Once saved, EgoX ingests the document automatically:

Chunk

The content is split into overlapping chunks so each retrievable piece is small and focused.

Embed

Each chunk is turned into a vector embedding and stored in the EgoX DB.

Ready to retrieve

The document's status moves through pending → processing → completed, and its chunk count appears in the list. A document that fails ingestion shows failed — re-upload it to retry.

Status at a glance. Each document shows a status chip — pending, processing, completed, or failed — and its number of chunks. Open a document to view its content and chunks.

How retrieval works at /ask

When RAG is enabled in AI Settings and a request needs grounding, EgoX embeds the user's message, finds the most relevant chunks across your knowledge base, and adds them to the model's context before it answers. The response reports how many chunks were used and marks the intent as rag (or rag_tools):

const res = await egox.ask({ message: 'What is the refund window?' });
console.log(res.ragChunksUsed);  // e.g. 3
console.log(res.intent);         // "rag"

Scope retrieval with tags

Pass tags on an /ask request to restrict retrieval to documents carrying those tags — useful when one project serves several domains and you want a request to draw only from the relevant slice.

Managing documents

  • Browse the Knowledge Base as cards or a table, with search and a source filter.
  • Inspect a document to read its content and see its chunks.
  • Re-upload a failed document to retry ingestion.
  • Delete documents you no longer want retrieved.

On this page