Connect
Create a crate, add a website or Git source, and define exactly what belongs in each ingestion job—manual or on a cron schedule.
ContextCrate is an open-source, self-hosted RAG platform that ingests your websites, Git repositories, and source code, retrieves what matters, and delivers grounded AI answers with evidence you can inspect—in its own UI, through MCP, or via an OpenAI-compatible API.

RAG—retrieval-augmented generation—connects a large language model to knowledge you control. Instead of relying only on what the model learned during training, it retrieves relevant source material for every question and uses that evidence to produce the answer.
That makes RAG important for real products: knowledge stays current, private information can remain on your infrastructure, and users can verify claims against the original sources. ContextCrate provides the complete open-source RAG pipeline—from ingestion and indexing to hybrid retrieval, cited generation, grading, and answer verification.
“What is our current backup policy?”
A plausible answer based on old or generic training data.
“Backups run daily with checksummed exports.” [1]
Websites, Git repositories, and source code flow into clean, structured documents—tables, code blocks, and headings intact.
Each run snapshots its configuration, so later edits never rewrite history.
Crawl over plain HTTP or with a headless Playwright browser. Honour robots policies, sign in to protected sites, retry on failure, and stay inside crawler safety limits. Pages that render client-side fall back to the browser automatically.
Read the docs ↗Import public repositories, or private ones over HTTPS with a token. Choose branches, tags, and paths, and include Markdown, plain text, source code, and images.
Read the docs ↗HTML is walked as a document tree, Markdown goes through CommonMark, and source code through tree-sitter—one block per function, class, or method. Remove and content selectors let you cut navigation noise.
Read the docs ↗A source can have several ingestion jobs with scope, include and exclude globs, limits, chunk size, and a cron schedule. Every run snapshots its configuration and shows its pipeline stages; one failed fetch only raises a warning.
Read the docs ↗Each document keeps its versions, chunks, and images. If the parsed text is identical to the current version, nothing is re-indexed.
Read the docs ↗Chunks are the unit of embedding, search, and citation. ContextCrate packs whole blocks, adds context, and indexes questions and captions next to the text.
Title On-Call Strategy for engineers
Summary How the platform team rotates on-call duty and escalates incidents.
Section Handbook › Escalation › Pager rules
Page the secondary on-call if the primary does not acknowledge within five minutes.
Chunks never cross a heading. Defaults: 1,000 characters with 200 overlap, set per job.
Documents are split into blocks, then whole blocks are packed into chunks of a configurable size and overlap. A chunk never crosses a heading; a block is only cut when it alone is too large.
Read the docs ↗Cut where the topic changes instead of at a fixed size. Sentence embeddings give a distance between neighbours, and a percentile, standard-deviation, or interquartile-range threshold decides the cuts.
Read the docs ↗A model writes a title and summary per document and the section path is added for free. Choose title, title and summary, or title, summary, and sections—so “on-call escalation” finds a chunk that never says it.
Read the docs ↗For every chunk the model writes 3 to 50 questions it can answer. They are indexed beside the chunk, so a user question is matched against questions—and the real chunk is returned.
Read the docs ↗Index meaningful images and skip icons and badges. A vision model describes pictures; the answer model captions tables and Mermaid, PlantUML, or Graphviz diagram code. Captions are embedded and link back to the source.
Read the docs ↗Use local ONNX models for air-gapped installs or any OpenAI-compatible endpoint. Store vectors in Lucene, OpenSearch, Elasticsearch, Qdrant, or PostgreSQL pgvector—even a dedicated backend per crate.
Read the docs ↗Change the embedding model and a new generation is built in the background while the old one keeps serving. Activation is atomic, so there is no downtime.
Read the docs ↗Lexical, semantic, and fused search—plus strategies for vague questions, large crates, and repeated content.
selected near-duplicate, skipped
Combine BM25 keyword search with semantic vectors. Pick lexical, semantic, hybrid, or fusion mode with reciprocal-rank or weighted score fusion, and filter by source.
Read the docs ↗Re-score the top candidates with a batched cross-encoder—local ONNX or remote—or with the answer model rating each chunk from 1 to 10. It never touches the index, so there is nothing to rebuild.
Read the docs ↗Rewrite vague or follow-up questions, step back to the underlying concept for very specific ones, or split multi-part questions into sub-queries. An Auto mode chooses for you.
Read the docs ↗Embed a hypothetical answer instead of the short question, because an answer looks like the passage that holds it. It is never stored or shown, and the final model never sees it.
Read the docs ↗Convert chunks into independently understandable factual statements and index only the ones that pass grading.
Read the docs ↗Add a summary level: find the best sections first, then search chunks only inside them. Large crates stop drowning the right passage in look-alikes.
Read the docs ↗Retrieve more candidates, then choose the K that are relevant to the question and different from each other, so sources stop repeating the same fact.
Read the docs ↗Retrieved context is graded, widened, compressed, and checked before and after the model writes a word—then streamed with citations.
Engineers hand the pager over every Monday morning [1]. If the primary does not acknowledge within five minutes, page the secondary [2].
Answers stream from any OpenAI-compatible model with inline citations and a stable source list that traces back to the original page, file, or commit. Built-in chat, REST, the OpenAI-compatible endpoint, and MCP all share it.
Read the docs ↗Every retrieved chunk is checked against the question, and only relevant ones become context. A rejected chunk never takes space from a good one.
Read the docs ↗Expand each match with 0 to 5 neighbouring chunks, joined as one continuous passage. It takes effect immediately, with no re-indexing.
Read the docs ↗A model keeps only the sentences of each chunk that matter for the question, drops duplicates, and renumbers the sources—fewer tokens, less distraction.
Read the docs ↗Three layers—built-in rules, an installation-wide prompt, and a crate prompt—shape tone, language, and focus. Later layers can adjust the answer but never overrule the rules before them.
Read the docs ↗The answer is checked claim by claim against the sources it was written from. Unsupported claims are revised once, the answer is blocked, or it is returned with a warning—your choice.
Read the docs ↗Attach pictures of retrieved image sources to multimodal models, and let the answer place a source image inline.
Read the docs ↗Readers rate relevance and quality from 1 to 5. Ratings can reweight later retrieval, and well-rated answers can become new documents. Open WebUI users get a rating link under the answer.
Read the docs ↗Change the chunk size, switch on HyDE or headers, and watch what happens to relevance and faithfulness.
A separate judge model scores sampled answers in the background and never delays an answer.
Did retrieval find the right chunks in a good order? Scored as Precision@K, Recall@K, MRR, MAP, and NDCG.
Read the docs ↗Run curated question sets against your crate, and track questions that came back unanswered to find gaps in your sources.
Read the docs ↗Sample live answers with a separate judge model, browse results on the crate’s Evaluation page (owners only), print reports, and follow Prometheus metrics in the Grafana dashboard with a crate selector.
Read the docs ↗Every crate speaks MCP and an OpenAI-compatible chat API, so assistants, IDEs, and chat UIs can search and ask your knowledge directly—with citations.
MCP integration ↗ OpenAI-compatible API ↗ REST API ↗MCP /api/v1/crates/{id}/mcp
API /api/v1/crates/{id}/v1/chat/completions
Tools search_crate · ask_crate · fetch_document
Every stage is explicit, observable, and scoped to the crate that owns it.
Create a crate, add a website or Git source, and define exactly what belongs in each ingestion job—manual or on a cron schedule.
ContextCrate acquires raw artifacts, parses pages, Markdown, code, and images, creates structure-aware or semantic chunks, and enriches them with metadata and context.
Search lexically, semantically, or in hybrid mode—optionally transforming the query, adding proposition retrieval, and reranking with a cross-encoder or LLM.
Generate an answer from selected evidence, expose stable citations, verify factual support, and score answer quality with built-in evaluation.
The same domain model and work contracts power a compact standalone install and independently scalable distributed roles.
Keep the operational footprint proportional to the workload.
Run the complete pipeline in one JVM with file-backed H2, filesystem artifacts, and Lucene.
$ docker run -p 8080:8080 \
ghcr.io/wenisch-tech/contextcrate:latest
compose.yml)CONTEXTCRATE_ADMIN_PASSWORD before exposing port 8080Scale acquisition, parsing, and indexing roles independently across production infrastructure.
The platform around the pipeline: isolation, integrations, governance, and operations.
Crawl websites with HTTP or a real browser—including login-protected sites—and import public or token-authenticated Git repositories. Define several jobs per source with include/exclude globs, limits, and cron schedules; each run snapshots its configuration. Parse HTML, Markdown, source code in nine languages, and images into versioned documents. Parsing ↗
Web + Git + codeEach crate owns its sources, members, artifacts, credentials, retrieval policy, and index namespace. Viewer, editor, and owner roles keep context from leaking across teams, and personal or crate-scoped cc_ service keys (viewer or editor) automate access.
Combine BM25 and semantic vectors with reciprocal-rank or weighted score fusion, then refine results with cross-encoder or LLM rerankers. Go further with hierarchical retrieval (best sections first, then chunks) and dartboard retrieval for relevant and diverse sources. Choose Lucene, OpenSearch, Elasticsearch, Qdrant, or pgvector.
Hybrid search + rerankingStructure-aware or semantic chunking, contextual headers, proposition retrieval, and 3–50 generated questions per chunk. Vision captions make images, tables, and diagrams searchable—plus query rewriting, step-back, sub-queries, and HyDE at search time.
Smarter queries & indexingStream cited answers from any OpenAI-compatible endpoint. Grade and compress retrieved context, widen it with 0–5 neighbouring chunks, verify claims (revise, block, or warn), pass images to multimodal models, and steer tone with layered system prompts.
Citations + verificationBuilt-in evaluation scores context relevance, faithfulness, answer relevance, and completeness with a judge model, plus Precision/Recall@K, MRR, MAP, and NDCG on golden sets. Track unanswered questions, run golden sets, and export printable reports.
RAG evaluationExpose each crate as an MCP server for Claude or Cursor, as an OpenAI-compatible chat endpoint for Open WebUI or LiteLLM, or through the REST API with scoped API keys.
MCP + OpenAI APISign in with OIDC/Keycloak, set policies for crate creation and shared models, audit time-limited admin elevation, and give a crate its own storage and search backend.
Identity + policiesSwitch embedding models by building a new index generation in the background while the old one keeps serving, then activate atomically. Duplicate, archive, or move crates between standalone and distributed with checksummed export/import, and watch it all in Prometheus and Grafana.
Resilient operationsUsers rate answers from 1 to 5. Ratings can reweight retrieval, and well-rated answers can be added back to the index so good answers keep getting better. Feedback ↗
Answer feedbackEvery RAG option is off by default and switchable per crate or job: chunking, retrieval, answer generation, and evaluation. Use local ONNX models or any OpenAI-compatible embedding, reranking, and answer endpoint.
Per-crate RAG tuningLicensed under AGPL-3.0 with no conversation storage. Run it from one Docker container to Kubernetes, or follow the upgrade guide if you are coming from Harvex. Upgrade guide ↗
AGPL-3.0
Your context. Your infrastructure.Explore the source, deploy ContextCrate, and turn your knowledge into context that earns trust.