SAGA
Provides object storage for original document binaries, enabling scalable and reliable document preservation and retrieval.
Provides on-premises LLM and embedding models for document enrichment (classification, extraction, summarization) and semantic search.
Provides cloud-based LLM and embedding models as an alternative provider for document enrichment and semantic search.
Provides hybrid keyword and vector search capabilities, enabling fused retrieval and filtering over documents and chunks.
Provides a task queue for asynchronous document processing (conversion, enrichment, indexing) using ARQ worker.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SAGAsearch for 'budget 2024' documents"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SAGA
SAGA — Self-organizing Archive for Generative Agents — is a self-organizing, AI-native document archive for RAG agents: ingest any text-convertible document, enrich it with LLM-extracted metadata, keep it in Postgres (system of record), project it into OpenSearch (keyword + vector), and let agents query it via fused hybrid search and organise it over MCP.
Status: 1.0.0 — the full ingestion-to-search pipeline is implemented (storage, REST API, conversion, LLM analysis, chunking/embeddings/indexing, hybrid search + MCP, and backup/export). See the implementation plan.
What it does
Ingest documents in many formats (PDF, Office, HTML, images, scanned docs, …) via the REST API.
Convert to Markdown using containerised Docling (PDF) and Kreuzberg (everything else, incl. OCR) — routing is configurable.
Enrich with an LLM: doc-type classification (first-class types), extraction of identifiers/numbers (invoice/contract numbers, phone numbers, IBANs, dates, amounts, …), a short summary, and placement into folders (hierarchical, n:m) using document-similarity voting.
Store the authoritative record in Postgres (documents, folders, doc-types, notes, memberships) and the original binary in MinIO; project text + summary + filter fields into an OpenSearch document index and chunk vectors into a separate vector index.
Search via an MCP server offering performant fused hybrid (keyword + semantic, RRF) retrieval, metadata filtering, and folder-tree browsing — plus write tools to reorganise documents, folders, doc-types, and notes.
Back up everything to a directory tree via a paginated export API + script.
See the architecture for details.
Related MCP server: okfy
Architecture at a glance
Client ──REST(Bearer)──► API ──┬─► Postgres (system of record)
├─► MinIO (originals)
├─► OpenSearch (doc projection + vector index)
└─► Redis ──► Worker (ARQ)
├─► Docling / Kreuzberg (convert)
├─► LLM (classify type / extract / summarise / place)
├─► Embeddings
├─► Postgres (persist)
└─► OpenSearch (project + index)
Agent ──MCP(HTTP, Bearer)──► MCP server ──► Postgres + OpenSearch (fused hybrid search) + EmbeddingsProviders (LLM + embeddings) are pluggable: Ollama (default), OpenAI, or Azure OpenAI — all configurable.
Quick start (Docker)
cp .env.example .env # then edit the secrets
docker compose up -d # starts the full stack
# Pull the default Ollama models (first run only)
docker compose exec ollama ollama pull llama3.1:8b
docker compose exec ollama ollama pull nomic-embed-textREST API + Swagger UI: http://localhost:8000/docs
MCP endpoint: http://localhost:8100
OpenSearch Dashboards: http://localhost:5601
MinIO console: http://localhost:9001
Local development
# Install uv: https://docs.astral.sh/uv/
uv sync # create venv + install deps (app + dev)
uv run ruff check . # lint
uv run ruff format --check . # format check
uv run mypy # strict type check
uv run pytest # unit testsConfiguration
All behaviour is driven by YAML in config/ with ${ENV} overrides for
secrets:
File | Purpose |
| API, MCP, security, OpenSearch, Postgres, MinIO, Redis, chunking, dedup, similarity. |
| File-type → converter routing (PDF→Docling, else→Kreuzberg). |
| LLM + embedding provider selection and models. |
| Log levels, colour, categories. |
Prompts and MCP tool descriptions live in prompts/.
Documentation
Start at the documentation index.
License
Apache-2.0 — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Agentic search over your Dewey document collections from any MCP-compatible client.
Agent-driven search: build, import, tune, search, and score result quality — all over MCP.
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables file system operations, web scraping, and AI-powered search through MCP tools for use by LLM agents.1-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search, read, and traverse documentation bundles in Open Knowledge Format via MCP tools.233 npm72MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to intelligently search and reference documentation using hybrid semantic + keyword search via MCP protocol.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to query and manage a document knowledge base via MCP, with RAG-powered search and grounded answers with citations.MIT