Open-source RAG platform

Turn your sources into trusted context.

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.

Self-hosted by design No conversation storage MCP & OpenAI-compatible
What is retrieval-augmented generation?

Give AI the right context before it answers.

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.

More relevantAnswers use the best available context
TraceableCitations lead back to source evidence
Under controlSelf-host your context and indexes
QUESTION

“What is our current backup policy?”

Without RAGUNSUPPORTED
LLM→

A plausible answer based on old or generic training data.

VS
With ContextCrateGROUNDED
010203
→

“Backups run daily with checksummed exports.” [1]

1
Operations handbook/docs/backup-policy · retrieved now
01Self-hostedYour infrastructure, your data
02AGPL-3.0Open source, end to end
03Your modelsLocal ONNX or any OpenAI-compatible endpoint
04Scale when readyStandalone to Kubernetes
Sources

Bring in the knowledge you already have.

Websites, Git repositories, and source code flow into clean, structured documents—tables, code blocks, and headings intact.

source → blocks
WebsiteHTTP · Playwright · login · robots
Git repobranch · tag · path · token
  1. Fetchretries, limits, crawler safety
  2. Parsejsoup · CommonMark · tree-sitter
  3. Blocksparagraph · list · table · code · image
  4. Versioned documentunchanged text is never re-indexed

Each run snapshots its configuration, so later edits never rewrite history.

  1. 01

    Website crawling

    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.

    HTTPPlaywrightRobots policyLogin
    Read the docs ↗
  2. 02

    Git repositories

    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.

    Branch & tagPath filtersToken auth
    Read the docs ↗
  3. 03

    Parsers that understand structure

    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.

    jsoupCommonMarktree-sitter9 languages
    Read the docs ↗
  4. 04

    Jobs, schedules & runs

    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.

    CronGlobsRun snapshots
    Read the docs ↗
  5. 05

    Versioned documents

    Each document keeps its versions, chunks, and images. If the parsed text is identical to the current version, nothing is re-indexed.

    Change detectionVersions
    Read the docs ↗
Chunking & index

Cut where the meaning is. Index what people will ask.

Chunks are the unit of embedding, search, and citation. ContextCrate packs whole blocks, adds context, and indexes questions and captions next to the text.

one chunk, as it is embedded

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.

#0#1#2#3

Chunks never cross a heading. Defaults: 1,000 characters with 200 overlap, set per job.

  1. 01

    Structure-aware chunking

    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.

    1,000 / 200 defaultsPer job
    Read the docs ↗
  2. 02

    Semantic chunking

    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.

    PercentileStd. deviationIQR
    Read the docs ↗
  3. 03

    Contextual chunk headers

    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.

    TitleSummarySection path
    Read the docs ↗
  4. 04

    Document enrichment

    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.

    3–50 questionsQuestion-to-question
    Read the docs ↗
  5. 05

    Images & captions

    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.

    Vision modelTablesDiagram code
    Read the docs ↗
  6. 06

    Embeddings & backends

    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.

    ONNXOpenAI-compatiblepgvectorQdrant
    Read the docs ↗
  7. 07

    Index generations

    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.

    Zero downtimeAtomic switch
    Read the docs ↗
Retrieval

Find the right passage, not just a similar one.

Lexical, semantic, and fused search—plus strategies for vague questions, large crates, and repeated content.

dartboard retrieval
question
  1. Transformrewrite · step-back · sub-queries
  2. SearchBM25 + vectors · HyDE
  3. FuseRRF or weighted
  4. Rerankcross-encoder or LLM

selected near-duplicate, skipped

  1. 01

    Hybrid search & fusion

    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.

    BM25VectorsRRF
    Read the docs ↗
  2. 02

    Reranking

    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.

    Cross-encoderLLM scoringNo rebuild
    Read the docs ↗
  3. 03

    Query transformation

    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.

    RewriteStep-backSub-queriesAuto
    Read the docs ↗
  4. 04

    HyDE

    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.

    Query timeNo rebuild
    Read the docs ↗
  5. 05

    Proposition retrieval

    Convert chunks into independently understandable factual statements and index only the ones that pass grading.

    Index time
    Read the docs ↗
  6. 06

    Hierarchical retrieval

    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.

    Section summariesTwo-step search
    Read the docs ↗
  7. 07

    Dartboard retrieval

    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.

    RelevanceDiversity
    Read the docs ↗
Answer generation

Answers that stay inside the evidence.

Retrieved context is graded, widened, compressed, and checked before and after the model writes a word—then streamed with citations.

grounded answer
  1. Grade
  2. Window
  3. Compress
  4. Generate
  5. Verify

Engineers hand the pager over every Monday morning [1]. If the primary does not acknowledge within five minutes, page the secondary [2].

✓ verified against sourcesverification: revise once
  • [1] Handbook › On-call
  • [2] Handbook › Escalation › Pager rules
Built-in rulesalways first
Installation promptadministrator
Crate promptcrate owner
  1. 01

    Streaming, cited answers

    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.

    StreamingInline citationsSource list
    Read the docs ↗
  2. 02

    Grading

    Every retrieved chunk is checked against the question, and only relevant ones become context. A rejected chunk never takes space from a good one.

    On by default
    Read the docs ↗
  3. 03

    Context window

    Expand each match with 0 to 5 neighbouring chunks, joined as one continuous passage. It takes effect immediately, with no re-indexing.

    0–5 neighbours
    Read the docs ↗
  4. 04

    Contextual compression

    A model keeps only the sentences of each chunk that matter for the question, drops duplicates, and renumbers the sources—fewer tokens, less distraction.

    Fewer tokens
    Read the docs ↗
  5. 05

    System prompts

    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.

    LayeredPer crate
    Read the docs ↗
  6. 06

    Answer verification

    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.

    ReviseBlockWarn
    Read the docs ↗
  7. 07

    Images in answers

    Attach pictures of retrieved image sources to multimodal models, and let the answer place a source image inline.

    Multimodal
    Read the docs ↗
  8. 08

    Answer feedback

    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.

    1–5 ratingsReweightingFeeds the index
    Read the docs ↗
Evaluation

Tune with numbers, not hunches.

Change the chunk size, switch on HyDE or headers, and watch what happens to relevance and faithfulness.

the RAG triad
QuestionChunksAnswerContext relevanceAnswer relevanceFaithfulness

A separate judge model scores sampled answers in the background and never delays an answer.

  1. 01

    Context relevance

    Did retrieval find the right chunks in a good order? Scored as Precision@K, Recall@K, MRR, MAP, and NDCG.

    P@KR@KMRRMAPNDCG
    Read the docs ↗
  2. 02

    Faithfulness

    Is every statement of the answer grounded in the retrieved chunks?

    Grounding
    Read the docs ↗
  3. 03

    Answer relevance & completeness

    Does the answer address the question, and all of it?

    RelevanceCompleteness
    Read the docs ↗
  4. 04

    Golden sets & unanswered questions

    Run curated question sets against your crate, and track questions that came back unanswered to find gaps in your sources.

    Golden setsGap tracking
    Read the docs ↗
  5. 05

    Reports & dashboards

    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.

    PrintablePrometheusGrafana
    Read the docs ↗
Works with your stack

Use your context wherever you work.

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 ↗
endpoints
MCP /api/v1/crates/{id}/mcp
API /api/v1/crates/{id}/v1/chat/completions
Tools search_crate · ask_crate · fetch_document
ClaudeCursorOpen WebUILiteLLMOpenAI SDKsREST APIOllamaKeycloakQdrantpgvectorOpenSearchElasticsearchS3 / MinIOPrometheusGrafana
From source to supported answer

A pipeline you can reason about.

Every stage is explicit, observable, and scoped to the crate that owns it.

01

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.

02

Structure

ContextCrate acquires raw artifacts, parses pages, Markdown, code, and images, creates structure-aware or semantic chunks, and enriches them with metadata and context.

03

Retrieve

Search lexically, semantically, or in hybrid mode—optionally transforming the query, adding proposition retrieval, and reranking with a cross-encoder or LLM.

04

Ground

Generate an answer from selected evidence, expose stable citations, verify factual support, and score answer quality with built-in evaluation.

Architecture without lock-in

Start in one process. Scale every stage.

The same domain model and work contracts power a compact standalone install and independently scalable distributed roles.

One canonical storeNormalized content remains the rebuildable source of truth.
Crate-aware everywhereIdentity travels with rows, artifacts, queue messages, and indexes.
Swappable infrastructureFilesystem or S3; Lucene, OpenSearch, Elasticsearch, Qdrant, or pgvector; local or hosted models—even per crate.
Read the architecture docs ↗
Deploy your way

A clean path from laptop to cluster.

Keep the operational footprint proportional to the workload.

Distributed

Scale acquisition, parsing, and indexing roles independently across production infrastructure.

PostgreSQLRabbitMQS3OpenSearch / Elasticsearch / QdrantKubernetesKEDA
  • Horizontally scalable workers
  • Queue-aware autoscaling
  • Helm chart included, Playwright rendering for crawls
  • Export a crate from one mode, import it into the other
  • Prometheus metrics + Grafana dashboard
At a glance

Everything else, in one place.

The platform around the pipeline: isolation, integrations, governance, and operations.

01

Bring your sources together

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 + code
02

Isolate every context space

Each 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.

Role-based access
03

Retrieve with precision

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 + reranking
04

Index meaning, not noise

Structure-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 & indexing
05

Answer with evidence

Stream 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 + verification
06

Measure answer quality

Built-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 evaluation
07

Plug into your tools

Expose 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 API
08

Govern with confidence

Sign 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 + policies
09

Evolve without downtime

Switch 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 operations
10

Learn from feedback

Users 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 feedback
11

Tune every crate

Every 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 tuning
12

Open and self-hosted

Licensed 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
ContextCrate’s layered blue crate logoYour context. Your infrastructure.

Build answers people can verify.

Explore the source, deploy ContextCrate, and turn your knowledge into context that earns trust.