← all repositories
FengZhenfei/carrel

A self-hosted brain for your agent, with receipts

Carrel turns a folder of messy documents into a queryable knowledge base — passages, images, and a knowledge graph — that agents can interrogate via API.

carrel
Collecting fresh signals — velocity needs a few days of history.
collecting data…
star history

What it does

Carrel is a self-hosted knowledge base built specifically for AI agents. It ingests PDFs, Office files, images, notebooks, source code, and more, then parses, chunks, and indexes them automatically. Agents query a retrieval API and get back source passages, images, and graph evidence — then generate their own answers instead of trusting a black box. A web console (English and Chinese) handles knowledge bases, models, and processing tasks, and a bundled search skill wires it into agents like Claude Code and Codex.

The interesting bit

The optional knowledge graph is the differentiator: entities, relationships, and facts are extracted with their sources, timestamps, and conflict indicators preserved, so an agent can trace an answer back to evidence and spot contradictions. The 0.3.0 evaluation is refreshingly concrete — on 176 documents and 99 questions, enabling the graph plus dual reranking lifted image hit@5 from 4/8 to 7/8, and cross-document source coverage from 5/10 to 8/10. The full pipeline hit 88.46% hit@5 and 0.7327 MRR@12 on 78 ranking questions.

Key highlights

  • Hybrid retrieval: vector, keyword, graph, and visual search with automatic knowledge-base selection and optional reranking with rank fusion
  • Scheduled tasks scan for file changes and update indexes and graphs incrementally; full rebuilds trigger on time or change thresholds
  • Graph rebuilds reuse parsed content and chunks without disturbing the RAG indexes
  • Stack: MinerU and native parsers, Qdrant, OpenSearch, Neo4j, SQLite for tracking; models can run locally or via hosted endpoints
  • Runs fully self-hosted; stores and model servers bind to loopback by default

Caveats

  • The “Agent Loop plugin” — continuous ontology learning and clarification-seeking — is explicitly in development and not yet implemented
  • Requires Python 3.12+, Docker 25+ with Compose v2, and external model endpoints (embedding, vision-language, chat); the local model stack needs an NVIDIA GPU
  • No native Windows support (WSL2 only), and macOS users must arrange scheduling themselves

Verdict

Worth a look if you’re building agents that need grounded answers over a living document collection — especially if you want provenance and conflict tracking, not just top-k chunks. If you wanted a turnkey hosted RAG service or the autonomous ontology-learning loop, that part isn’t here yet.

Frequently asked

What is FengZhenfei/carrel?
Carrel turns a folder of messy documents into a queryable knowledge base — passages, images, and a knowledge graph — that agents can interrogate via API.
Is carrel open source?
Yes — FengZhenfei/carrel is open source, released under the MIT license.
What language is carrel written in?
FengZhenfei/carrel is primarily written in Python.
How popular is carrel?
FengZhenfei/carrel has 643 stars on GitHub.
Where can I find carrel?
FengZhenfei/carrel is on GitHub at https://github.com/FengZhenfei/carrel.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.