---
title: "Knowledge bases"
url: "https://docs.mekodata.ai/architecture/core-concepts/knowledgebase/"
---

# Knowledge bases

RAG pipeline that parses, chunks, embeds, and indexes your documents

A **knowledge base** in Meko is a RAG (Retrieval-Augmented Generation) pipeline that ingests your documents, breaks them into chunks, generates vector embeddings, and indexes them for semantic search. Agents can then query the knowledge base to find relevant information from your documents.

How should I store it?

A datapack keeps memories, knowledge-base files, and artifacts. To learn which one to use, see [Where to store it](/guides/where-to-store/).

## How it works

When you add a knowledge base to a datapack using the Meko UI, Meko's `pg_dist_rag` pipeline:

1. **Fetches documents** from the source (S3, local filesystem, a web page, or an NFS mount).
2. **Preprocesses** to extract text from PDFs, HTML, markdown files, text files, images, parquet, iceberg, JSON, and more.
3. **Chunks** the text into segments (configurable chunk size).
4. **Embeds** each chunk using the configured embedding model.
5. **Indexes** the embeddings in pgvector for fast similarity search.

All of this happens within your datapack's database; there's no separate vector database to manage.

## Supported document formats

Currently, Meko accepts PDF, TXT, TEXT, MD, CSV, JSON, XML, HTML, and HTM files, up to 10 per batch in the portal. The per-file size cap depends on your plan: 5 MB on Free, 50 MB on Standard, and 60 MB on Pro.

Free tier

Free accounts are limited to **100 MB** of total storage across all datapacks for knowledge-base files and [artifacts](/guides/working-with-artifacts/) combined, with individual files capped at **5 MB**. Standard accounts get **5 GB** of total storage and **50 MB** per file.

When storage is full, the banner shows the amount used. See [Reach a tier limit](/architecture/core-concepts/datapacks/#reach-a-tier-limit).

Documents can be uploaded to your datapacks in the Meko portal, by an agent [over MCP](/guides/working-with-knowledge-bases/#upload-from-your-agent), or using the [Datapack API](/reference/datapack-api/#upload-a-file).

## Query knowledge

Once indexed, agents can query the knowledge base through the MCP server. The MCP tool for knowledge search handles embedding the query, performing similarity search, and returning relevant chunks.

## Next steps

- [Work with knowledge bases](/guides/working-with-knowledge-bases/) - How to build and query knowledge bases
- [Learn about datapacks](/architecture/core-concepts/datapacks/)
