首次启动会下载 MinerU 解析器资源,需预留时间与网络;Carrel 不启动模型服务也不下载权重,需自行配置 LLM、Embedding、Reranker 端点;Standard 与 Light 版本在部署目录中固定,选定后不能切换;控制台默认只绑定 localhost,局域网访问需同时设置 KB_WEB_HOST 与 KB_WEB_TOKEN。
carrel
FengZhenfeiMIT活跃维护把文档解析、知识图谱和向量检索串成一套本体增强的 RAG 方案,让 AI Agent 基于结构化知识作答,减少胡编乱造。
Ontology-Augmented Generation for AI agents.
git clone https://github.com/FengZhenfei/carrel.git
cd carrel
./deploy.sh --standard --build需 Docker 与 Compose v2;GPU 解析需 NVIDIA GPU 及 NVIDIA Container Toolkit,也支持纯 CPU 解析;macOS 用 Docker Desktop 跑 CPU 解析,Windows 需 WSL2。README 未给出具体显存要求,资源需求取决于解析器与文档规模。
自托管知识库,为 AI 智能体提供文档解析、混合检索与可选知识图谱
把文档解析、知识图谱和向量检索串成一套本体增强的 RAG 方案,让 AI Agent 基于结构化知识作答,减少胡编乱造。
核心能力
- 解析 PDF、Office、图片、代码等多格式文档并自动切块
- 融合向量、关键词、图谱与视觉检索,支持重排序
- 从文档抽取实体、关系与事实,保留来源与时间信息
- 提供检索 API,可回取原文段落、原图并沿图谱追证
- Web 控制台管理知识库、模型与后台处理任务
容易踩的坑
- v0.4.2Carrel 0.4.2最新正式版2026-11-08 · 2026-11-08 07:47 UTC
Carrel 0.4.2
English | 中文
This release adds Light and Standard deployment editions, packages the application and scheduler in a container, and separates model configuration from service deployment. The parsing, graph extraction and retrieval algorithms continue from 0.4.1.
Deployment and storage
- Standard uses Qdrant, OpenSearch and Neo4j through a shared storage interface.
- Light uses embedded LanceDB and DuckDB for vector, keyword and graph access, including source readback, time-scoped facts, graph versions and maintenance. SQLite tracks application state in both editions.
- Both editions use the same application image. It runs the console, search API and a persistent background scheduler. MinerU remains an integrated, separate parser container. The host needs Docker with Compose v2.
deploy.shis now an optional Compose helper. Scheduled work runs inside the application container, with persistent queues and restart recovery.- Choose the edition when deploying. Each data directory keeps that choice.
Model configuration and console
- System settings has separate LLM, Embedding and Reranker sections. Configure endpoints, model IDs and keys independently; Carrel does not deploy these model servers or download their weights. MinerU still downloads its own parser assets.
- Saving a model configuration checks its endpoint. Text embeddings must return the configured dimensions; visual checks send synthetic images. Failed checks preserve the saved configuration.
- Embedding batch size and request concurrency are configurable. LLM settings add a multimodal flag and a concurrency limit used by image descriptions and graph jobs.
- Parsing and graph controls share start, pause and resume behavior. Model cards, key visibility and bilingual labels are aligned. Light omits System services; container lifecycle is managed through Compose.
Deploy or upgrade
git clone --branch v0.4.2 https://github.com/FengZhenfei/carrel.git cd carrel ./deploy.sh --standard --build # Or: ./deploy.sh --light --buildOpen
http://127.0.0.1:9800, configure model endpoints, and add document folders underdata/runtime/mirror/. Use--gpufor GPU parsing with NVIDIA Container Toolkit.For an existing Standard installation, retain its configuration, source documents, state database, indexes, graphs and parser caches, and map them into the new deployment. Stop the old scheduler before starting the container scheduler. The retained assets can be reused without reparsing or rebuilding graphs. Model URLs must be reachable from the application container;
127.0.0.1refers to that container. After migration, manage the application with Compose.Container deployment · Storage editions · Model configuration
The 0.4.1 retrieval and codebase evaluation remains the reference for those measured results.
- v0.4.1Carrel 0.4.12026-11-04 · 2026-11-04 17:26 UTC
查看更新说明
English | 中文
- Text queries. An optional retrieval profile ranks vector and keyword matches first. The service then follows graph references, checks each passage against its indexed version, and appends up to six source passages. The response identifies which passages came from graph follow-up.
- Image queries. Text and visual hits share the same top-K. When graph exploration is enabled, queries without a document filter can also return up to two subjects and two one-hop neighbors per subject for further exploration.
- Follow-up evidence. The search Skill carries document and graph versions and the original time scope into follow-ups. A stale reference returns HTTP 409 so the agent can look up the source again. Image and crop requests honor the same time scope. Follow-up suggestions cover specific questions the answer has left open.
The general benchmarks repeat the 0.4.0 text, image and document-answer tests and separately replay the 0.3.0 retrieval suite. The codebase evaluation compares Haiku’s answers to 24 questions with and without follow-up on 0.4.1. Full evaluation
Upgrade from 0.4.0
Update to tag
v0.4.1, refresh the bundledcarrel-searchSkill in your agent, and restart the search service. To enable the text profile used in this evaluation, setKB_SEARCH_TEXT_DISCOVERY=truein the search service environment before restarting. It is opt-in. Existing chunks, indexes and graphs can be used directly. - v0.4.0Carrel 0.4.02026-11-02 · 2026-11-02 17:59 UTC
查看更新说明
This release connects source-preserving parsing, graph evidence and ontology review more closely. It adds scoped correction APIs and graph-version comparison, and moves multimodal parsing to models selected per knowledge base.
Parsing and evidence
- Preserve code whitespace, line ranges and configuration fields through parsing, chunking, graph extraction and source readback. Resolve code imports within their project and package scope.
- Improve PDF code recognition, section attribution, short-table recovery and row alignment. Recover visible form fields and retain images embedded in spreadsheets with their sheet and row locations.
- Pack adjacent short text when section and source boundaries support it. Keep code, tables and figures attached to their original evidence regions.
- Retain informative visual content, mark truncated or uncertain model output, and preserve original table text when a replacement cannot be aligned.
Graphs and ontology
- Preserve negated, conditional and uncertain claims with their qualifiers. Carry entity identity and scope information into extraction, and validate relationship endpoints against the schema.
- Carry observation dates, units, conditions and source locations into facts and cross-document series. Default retrieval retains historical, conflicting and future claims; fact queries with an explicit cutoff date filter both facts and change summaries.
- Reuse schema definitions supported by current source evidence, account for uncovered document types and retain endpoint-use statistics for review. Corpus changes can introduce new types without treating past frequency as a permanent constraint.
- Compare graph versions and distinguish changed source material from changed extraction output. Keep three graph versions by default and retain schema versions referenced by retained builds.
- Add preview, commit and revoke APIs for corrections scoped to knowledge-base identity, graph version and source evidence. Track stale records and preserve correction outcomes when a build resumes.
Retrieval and model configuration
- Share model-parameter compatibility across connectivity checks, graph calls and image descriptions. Keep free-form model registration and add scoped overrides for custom deployments.
- Improve fused text/image candidate selection, source diversity and bounded original-text excerpts. The search Skill can navigate documents, locate phrases and follow graph evidence with reusable source references.
- Choose one multimodal model from the console registry for each knowledge base. Images, charts and table review share it; later parsing tasks use the current selection.
- Remove the bundled local VLM container. The optional local-model profile now provides four embedding and reranking services. Vision endpoints can run on another host or through a compatible provider.
Web console
- Complete bilingual progress and error messages, including messages containing Chinese model or knowledge-base names.
- Unify parsing and graph-build stages, actual work counts and waiting states. Task details show models, versions and stage records; overall progress is marked as an estimate.
- Add explicit pause and resume controls for parsing.
- Improve file-list layout with stable column widths, a resizable sidebar, compact parsing notes and direct page selection.
Design
Carrel keeps original evidence, RAG indexes and ontology graphs connected. Technical checks establish source identity, structural consistency and time scope. Reviewed corrections capture business interpretation with supporting evidence.
The Agent Loop plugin remains in development and is not yet implemented. It is intended to help agents learn an enterprise ontology, seek clarification from people and contribute evidence-backed governance feedback.
Capability evaluation
The 0.4.0 evaluation cov
- v0.3.1Carrel 0.3.12026-10-26 · 2026-10-26 13:36 UTC
查看更新说明
This release expands file format support and improves source fidelity, console loading, and macOS iCloud synchronization.
Parsing and source references
- Add static readers for R, Jupyter Notebook, RST, Quarto/RMarkdown, TeX/BibTeX, JSONL, TSV, Nextflow/CWL/WDL, Snakefiles, Feature, DOT, XSD, logs, and recognized extensionless scripts.
- Preserve notebook cells, code and saved outputs together. Carry cell, output, line and row locations through to search results.
- Recover PDF titles and body text misclassified as headers, and retain the original page range of merged tables in citations.
- Preserve TeX section hierarchy and HTML template content. Filter HTML comments from Markdown prose while retaining code examples and front matter.
- Keep standalone image content, avoid stacking generated figure descriptions, and reduce false heading-only chunk warnings.
Ingestion and console
- Filter Git LFS pointers during scanning so they stay out of file lists, counts and parsing queues. Restored originals enter the normal ingestion flow; existing index entries are withdrawn when a file becomes a pointer.
- Fix saving the configuration of a newly enabled knowledge base and keep completed label-extraction tasks in their final state.
- Improve file-list loading on slow connections with compressed responses, request timeouts and recovery. Prevent duplicate requests and results from a previously selected library, and make mobile navigation more compact.
macOS iCloud sync example
- Use a default window of 64 pending downloads, refilling slots as downloads finish. Improve timeouts, retries and fallback from the download helper to the system downloader.
- Recover scan notifications after interrupted transfers and refresh mirror locks during long copies. Updating the sync installation waits for existing agents to stop.
Documentation
- Add the bilingual 0.3.0 retrieval evaluation, covering retrieval accuracy, graph contribution and parallel reranking, with links from the README and retrieval guide.
Upgrade from 0.3.0
- Update the checkout to
v0.3.1and run./deploy.shwith your usual deployment options. - On Linux, run
systemctl --user restart carrel-web carrel-search. On other hosts, restart the corresponding application processes. - If you use the macOS iCloud sync example, update the scripts in your installed sync folder and rerun
./install.sh, keeping your existingsync.env.
Existing documents retain their parsed results and caches. Newly supported formats enter through incremental scans and follow each library's graph settings. Reparse selected files in the console to apply the parsing improvements to previously indexed documents.
For upgrades from 0.2, first follow the graph migration steps in the 0.3.0 release notes.
- v0.3.0Carrel 0.3.02026-10-25 · 2026-10-25 19:29 UTC
查看更新说明
Changes
- Versioned LinkML schemas with eight upper classes, type inheritance, class/instance distinctions, and scoped entity identity.
- Table row extraction, external identifiers, source references, and current/historical evidence views.
- Automatic label sampling based on corpus coverage and the model's Max Input, with a 30% input budget and background task progress.
- Per-library correction files, included in backups and cleaned up with library deletion.
- Schema and graph statistics APIs, optional hosted text reranker model and API Key settings.
- Parallel text/image reranking with independent relevance gates, rank fusion and text fallback.
- Search skill updates for source images, targeted graph lookups, and clearer fact-quality and historical-evidence handling.
Design choices in this release
-
Types and identity: Expand the upper classes to eight and express inheritance, identity scope, and class/instance distinctions in LinkML. Together with table row extraction and external identifiers, this gives entity resolution more explicit evidence.
-
Sampling and capacity: Replace a manually set sample count with automatic sampling that considers corpus size, content diversity, and model capacity. A 30% input budget balances coverage with context cost.
-
Time and corrections: Current and historical views distinguish successive facts. Corrections belong to a library, survive graph rebuilds, and are removed when the library is deleted, keeping revisions reusable without passing old rules to a new library.
-
Text and images: Each model judges relevance on its own scale; rank fusion combines the accepted results. Bounded image candidates and parallel scoring keep the existing request budget. The skill uses source images and focused follow-up queries where they help answer the question.
Upgrade from 0.2
- Run
app/.venv/bin/kb cleanup backupand delete existing graphs in the console. Parsed files and RAG indexes remain available. - Update the checkout to
v0.3.0and run./deploy.shwith your usual deployment options. - On Linux, restart
carrel-webandcarrel-searchwithsystemctl --user restart carrel-web carrel-search. On other hosts, restart those application processes. - Fill in Max Input for graph models, extract labels, and rebuild each enabled graph. Existing parsing and chunks are reused.
The graph format changes in 0.3.0. API clients use
uppersin place ofparent_types,upperin entity results, and the eight classesagent,entity,part,property,process,event,concept, anddocument. Select or upload a schema version to change types and relationships. The bundled search skill includes these changes.
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Carrel
English | 中文
Ontology-Augmented Generation for AI agents.
Carrel is a self-hosted knowledge base for AI agents. It automates document parsing, indexing, and retrieval, with optional knowledge graphs. Agents use its API to retrieve source passages, images, and related facts, then generate their own answers.
Use it to give an agent access to a collection of product documents, research, contracts, meeting notes, or other files that change over time. A web console manages knowledge bases, models, and processing tasks. A bundled search skill connects agents such as Claude Code and Codex to the retrieval service.
0.4.1 general retrieval benchmarks and codebase capabilities · Full 0.4.0 capability evaluation
Features · Evaluation · Design · Quick start · Agent integration · Documentation
Features
0.4.2 changes and upgrade steps — Light and Standard editions, container deployment, and independent model configuration.
- Document parsing: PDF, Word, PowerPoint, spreadsheets, images, HTML, Markdown, notebooks, source code, and workflow files, with processing suited to each format. Format details.
- Automatic updates: scan for file changes, update indexes, and maintain enabled knowledge graphs through scheduled tasks.
- Hybrid retrieval: combine vector, keyword, graph, and visual search, with automatic knowledge-base selection and optional text/image reranking with rank fusion.
- Knowledge graphs: extract entity types, relationships, and facts from your documents; retain sources, time information, and conflict indicators, compare graph versions, and apply reviewed, evidence-scoped corrections.
- Agent access: search through an API, fetch surrounding text or original images, and follow graph relationships when more evidence is needed.
- Web console: configure processing, inspect chunks and graphs, track tasks, and manage services. Available in English and Chinese.
Capability evaluation
Across 275 text queries, 0.4.1 reached 93.45% evidence Hit@5 and 0.8141 MRR@10. In a separate study of 24 code questions, Haiku answered 13 completely from the first response and 23 with Skill follow-up. 0.4.1 evaluation
The full 0.4.0 evaluation also covers graph rebuild stability, time-scoped evidence, conflicts and ontology governance. Full 0.4.0 technical report
How it works
flowchart LR
D[Document folders] --> P[Parse and chunk]
P --> I[Vector and keyword indexes]
P --> G[Optional knowledge graphs]
I --> R[Retrieval API]
G --> R
R --> A[AI agent]
A -->|Follow-up queries| R
Carrel uses MinerU and native parsers for ingestion. Standard uses Qdrant, OpenSearch and Neo4j; Light uses embedded LanceDB and DuckDB. SQLite tracks files and tasks in both editions. Model services run independently, locally or through compatible hosted endpoints. See Architecture for the pipeline and retrieval design.
Design
Carrel provides general knowledge storage, retrieval, and evidence interfaces. Entities, relationships, and facts retain sources, time information, and conflicts so agents can check and use them alongside the original documents. Default retrieval retains historical and future source claims. An explicit time query selects the relevant evidence; reviewed corrections record which sources and identities the decision applies to. The Agent Loop plugin is in development and not yet implemented. It is intended to use these interfaces to continuously learn an enterprise ontology, seek clarification from relevant people, and maintain correction rules.
Routine graph updates merge new and changed content incrementally. Configured time or change thresholds trigger full rebuilds, balancing update cost with overall consistency. Parsing, indexing, and graph construction are maintained separately: rebuilding a graph can reuse parsed content and chunks while preserving RAG indexes.
Requirements
- Docker with Compose v2. Python and background scheduling run inside the application container.
- A text embedding endpoint; a vision-language endpoint for image descriptions; and a chat model for knowledge graph construction, if enabled.
- An NVIDIA GPU and NVIDIA Container Toolkit for GPU parsing. CPU parsing is also supported. Resource needs depend on the parser and collection size.
| Platform | Deployment |
|---|---|
| Linux with NVIDIA GPU | GPU parsing with NVIDIA Container Toolkit; container scheduling |
| Linux without GPU | CPU parsing; connect to model services on another host or a provider |
| macOS with Docker Desktop | CPU parsing and application containers, including scheduling |
| Windows | Use WSL2; native Windows deployment is not supported |
Example setup describes the author's installation on an NVIDIA DGX Spark and some lighter alternatives.
Quick start
1. Deploy the services
git clone https://github.com/FengZhenfei/carrel.git
cd carrel
./deploy.sh --standard --build
# Or use embedded storage:
# ./deploy.sh --light --build
The optional script prepares Compose configuration and starts the application, background scheduler and selected dependencies. You can also use Compose directly. First startup downloads MinerU parser assets. See Container deployment.
2. Configure model endpoints
Choose Standard for Qdrant, OpenSearch and Neo4j, or Light for embedded LanceDB and DuckDB. The edition is fixed for that deployment directory. Both include MinerU; Light has no database containers. See Storage editions.
In System settings, configure LLM, Embedding and Reranker endpoints, model IDs and API keys. Register a vision-capable LLM and select it as the Multimodal model for each knowledge base. Images, charts and table review share that selection. Models can run on your own machines or hosted platforms. Carrel does not start these model services or download their weights. See Model configuration.
3. Add documents
Open the console at http://127.0.0.1:9800. Put documents in
data/runtime/mirror/<folder>/, then enable that folder in the console. Each
enabled folder becomes a knowledge base; scheduled tasks process its files.
For a knowledge graph, register a chat model with its Max Input in the console, select it in the knowledge-base settings, and enable graph building. Check service health and task progress in the console before making your first query.
Agent integration
Install the bundled carrel-search skill in your agent, or call the API directly:
curl -sS http://127.0.0.1:9810/search \
-H 'Content-Type: application/json' \
-d '{"question": "What are the delivery and acceptance requirements?", "top_k": 8}'
If you set KB_SEARCH_TOKEN, add an Authorization: Bearer … header.
For a remote agent,
configure CARREL_SEARCH_BASE_URL and CARREL_SEARCH_TOKEN in its environment.
Responses include source passages and, when available, graph evidence and image information. Agents can request more context, inspect images, and follow relationships before answering. See Retrieval and API for authentication, response status, and citations.
Documentation
| Guide | Contents |
|---|---|
| Configuration | Model endpoints, folders, per-base settings, and access control |
| Architecture | Parsing, graph construction, retrieval, and code layout |
| Retrieval and API | Agent setup, endpoints, evidence status, and evaluation |
| Retrieval and codebase evaluation (0.4.1) | Document retrieval, page-image location, Skill follow-up and cross-file code analysis |
| Capability evaluation (0.4.0) | Full technical report: retrieval, answers, temporal evidence, conflicts, ontology, rebuild stability, latency, and token usage |
| Operations and development | Console, CLI, scheduling, troubleshooting, and tests |
| Test scope | Shared regression contracts, deployment-specific checks, and live evaluations |
| Example setup | The author's installation on a DGX Spark, a Mac that syncs the documents, and lighter alternatives |
| Docker Compose | Infrastructure, model weights, and container settings |
| Container deployment | Images, scheduling, persistent data and updates |
| systemd | Native/source installation |
Data and access
The console binds to localhost by default. For LAN access, set both
KB_WEB_HOST and KB_WEB_TOKEN. Configure KB_SEARCH_TOKEN before using
protected search endpoints remotely. The stores and model servers listen on
loopback only, which keeps other machines out but not web pages opened in a
browser on the same host, so avoid browsing the web there.
Documents and images are sent to the model endpoints you configure. Local endpoints keep model processing within your own infrastructure. See Access and data handling.
License
Carrel is licensed under MIT. Dependencies and model weights have
their own licenses; see Third-party notices. Original-resolution
PDF image retrieval uses an optional dependency installed with
./deploy.sh --with-pdf-images; without it, retrieval uses cached images.