[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-875":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":14,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":14,"starSnapshotCount":14,"syncStatus":24,"lastSyncTime":25,"discoverSource":26},875,"ForgeRAG","deeplethe\u002FForgeRAG","deeplethe","Production-Ready RAG with Structure-Aware Reasoning",null,"Python",658,53,38,0,9.2,"MIT License",false,"main",true,[],"2026-06-12 02:00:19","\u003Cp align=\"center\">\n  \u003Cimg src=\"web\u002Fpublic\u002Ftext_logo_padding.png\" alt=\"ForgeRAG\" height=\"64\">\n\u003C\u002Fp>\n\n\u003Ch2 align=\"center\">Production-Ready RAG with Structure-Aware Reasoning\u003C\u002Fh2>\n\n\u003Cp align=\"center\">\n  \u003Cstrong>LLM Tree Reasoning\u003C\u002Fstrong> ◦ \u003Cstrong>Knowledge Graph Multi-Hop\u003C\u002Fstrong> ◦ \u003Cstrong>Pixel-Precise Citations\u003C\u002Fstrong> ◦ \u003Cstrong>Unmatched Performance\u003C\u002Fstrong>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdeeplethe\u002FForgeRAG\u002Freleases\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fversion-0.2.2-brightgreen?style=for-the-badge\" alt=\"Version\">\u003C\u002Fa>\n  \u003Ca href=\"LICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg?style=for-the-badge\" alt=\"License: MIT\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdeeplethe\u002FForgeRAG\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fdeeplethe\u002FForgeRAG?style=for-the-badge\" alt=\"Stars\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdeeplethe\u002FForgeRAG\u002Fissues\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fdeeplethe\u002FForgeRAG?style=for-the-badge\" alt=\"Issues\">\u003C\u002Fa>\n  \u003Ca href=\"docs\u002F\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocs-docs%2F-blue?style=for-the-badge\" alt=\"Docs\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FXJadJHvxdQ\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDiscord-Join-7289da?style=for-the-badge&logo=discord&logoColor=white\" alt=\"Discord\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#quick-start\">Quick Start\u003C\u002Fa> •\n  \u003Ca href=\"#features\">Features\u003C\u002Fa> •\n  \u003Ca href=\"#technical-approach\">Technical Approach\u003C\u002Fa> •\n  \u003Ca href=\"docs\u002F\">Docs\u003C\u002Fa> •\n  \u003Ca href=\".\u002FREADME_CN.md\">中文\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\n\u003Cp align=\"center\">\u003Cimg src=\"docs\u002Fimages\u002Farchitecture.png\" alt=\"ForgeRAG Architecture\" width=\"700\">\u003C\u002Fp>\n\n### The Problem with Existing Approaches\n\nMany approaches have been proposed to go beyond naive chunk-and-embed RAG, but each has fundamental limitations:\n\n| Approach | Strength | Limitation |\n|----------|----------|------------|\n| **Embedding-based** (e.g. naive RAG) | Fast semantic search | Similarity ≠ relevance; misses exact-match and structural context |\n| **Graph-based** (e.g. GraphRAG) | Cross-document entity linking | Concept skeleton without source-text evidence; extraction loses details |\n| **Hybrid graph** (e.g. LightRAG) | Dual-level retrieval (local + global) | Answers synthesized from KG summaries, not grounded in original text; higher hallucination risk |\n| **Reasoning-based** (e.g. PageIndex) | High single-doc accuracy | Query latency scales linearly with document count; not production-ready |\n\n### Our Approach: Think Like a Domain Expert\n\nWhen a domain expert encounters a question, they don't scan every page — they instantly recall where relevant information lives, draw on their mental map of how concepts connect, then synthesize a grounded answer from multiple sources. ForgeRAG mirrors this workflow: **BM25 + vector search** surfaces candidate regions in milliseconds, a **knowledge graph** provides the conceptual connections across documents, and **LLM tree navigation** reasons over document structure to pinpoint the exact sections that matter — all fused into a single answer with traceable citations.\n\nTo handle **multi-hop questions** (e.g. *\"Which suppliers of Apple also supply Samsung?\"*), we introduce a **knowledge graph** path that extracts entities and relations at ingestion time, then runs dual-level retrieval at query time: **local** (query entities → neighborhood traversal) and **global** (keywords → fuzzy \u002F cross-lingual entity match via name embeddings), plus **relation-semantic** search over relation-description embeddings. Inspired by LightRAG's context assembly, the KG path injects **synthesized entity and relation descriptions** directly into the generation prompt — giving the LLM a \"distilled knowledge layer\" on top of raw text chunks.\n\n### Benchmark: ForgeRAG vs LightRAG\n\nWe evaluate against [LightRAG](https:\u002F\u002Fgithub.com\u002FHKUDS\u002FLightRAG) using the **UltraDomain** benchmark methodology (LLM-as-judge pairwise comparison). Win rates shown as **ForgeRAG% \u002F LightRAG%**.\n\n> 🚧 **More comprehensive benchmarks against additional RAG systems, domains, and metrics are in progress.**\n\n| Domain | Comprehensiveness | Diversity | Empowerment | Overall |\n|--------|:-----------------:|:---------:|:-----------:|:-------:|\n| **Agriculture** | **58.6** \u002F 41.4 | 47.1 \u002F **52.9** | **52.9** \u002F 47.1 | **56.4** \u002F 43.6 |\n| **CS** | **55.6** \u002F 44.4 | 48.4 \u002F **51.6** | **54.0** \u002F 46.0 | **54.8** \u002F 45.2 |\n| **Legal** | **57.0** \u002F 43.0 | 46.5 \u002F **53.5** | **53.5** \u002F 46.5 | **55.6** \u002F 44.4 |\n| **Mix** | **56.3** \u002F 43.7 | 47.8 \u002F **52.2** | **54.3** \u002F 45.7 | **55.1** \u002F 44.9 |\n\n\u003Csub>Judge: qwen3-max · [Reproduce](scripts\u002Fcompare_bench.py)\u003C\u002Fsub>\n\n> **Note on Faithfulness:** The UltraDomain benchmark evaluates Comprehensiveness, Diversity, and Empowerment — but not factual accuracy. ForgeRAG provides pixel-precise `[c_N]` citations for every claim, enabling verification against source text. LightRAG synthesizes answers from knowledge graph summaries without traceable citations, which scores well on breadth but carries higher hallucination risk.\n\n## Features\n\n\u003Cp align=\"center\">\u003Cimg src=\"docs\u002Fimages\u002Fchat_demo.gif\" alt=\"ForgeRAG Demo\" width=\"700\">\u003C\u002Fp>\n\nCompared to heavier platforms like RAGFlow, ForgeRAG focuses on **core pipeline design** — a lean retrieval-answering chain with composable building blocks.\n\n🔍 **Dual-reasoning retrieval** · BM25 + vector pre-filter → LLM tree nav + KG, fused via RRF\n\n📌 **Pixel-precise citations** · Every claim links to exact page + bounding box, click to highlight\n\n🔗 **Full retrieval tracing** · Inspect path scores, expansion decisions, and merge logic per query\n\n💬 **Multi-turn conversations** · Context-aware follow-ups with conversation history\n\n📄 **Multi-format ingestion** · PDF, DOCX, PPTX, XLSX, HTML, Markdown, TXT\n\n⚙️ **YAML-first config** · One file, one restart — no hidden runtime state\n\n🎛️ **Per-request overrides** · Toggle retrieval paths \u002F top-ks \u002F rerank per query via `QueryOverrides` (great for SDK + A\u002FB)\n\n🏆 **Outperforms LightRAG** · 55.48% overall win rate on UltraDomain benchmark\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>\u003Cfont size=\"4\">📸 Screenshots\u003C\u002Ffont>\u003C\u002Fstrong>\u003C\u002Fsummary>\n\u003Cbr\u002F>\n\n**Chat** · Structured answers with pixel-precise citations\n\n\u003Cimg src=\"docs\u002Fscreenshots\u002Fchat_sample.png\" alt=\"Chat\" width=\"700\">\n\n**Ingestion** · Document processing pipeline with tree building\n\n\u003Cimg src=\"docs\u002Fscreenshots\u002Fingest_demo.png\" alt=\"Ingestion\" width=\"700\">\n\n**Knowledge Graph** · Entity-relation visualization\n\n\u003Cimg src=\"docs\u002Fscreenshots\u002Fkg_demo.png\" alt=\"Knowledge Graph\" width=\"700\">\n\n\u003C\u002Fdetails>\n\n## Quick Start\n\n### Prerequisites\n\n- Python 3.10+\n- Node.js 18+ (for building the frontend)\n- An LLM API key (OpenAI, DeepSeek, or any LiteLLM-compatible provider)\n- Recommended: 4+ CPU cores, 8GB+ RAM (16GB+ for large documents with KG extraction)\n\n### Option A: Local Development\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fdeeplethe\u002FForgeRAG.git\ncd ForgeRAG\n\n# 1. Core Python dependencies (small — the heavy backend packages are\n#    installed lazily in step 3 based on what your config actually picks).\npython -m venv .venv\nsource .venv\u002Fbin\u002Factivate   # Windows: .venv\\Scripts\\activate\npip install -r requirements.txt\n\n# 2. Frontend\ncd web && npm install && npm run build && cd ..\n\n# 3. Configure: interactive wizard generates forgerag.yaml AND auto-pip-installs\n#    the backend-specific deps your choices need (e.g. chromadb, neo4j, mineru).\n#    To re-sync deps after a manual yaml edit: python scripts\u002Fsetup.py --sync-deps forgerag.yaml\npython scripts\u002Fsetup.py\n\n# 4. Run — defaults to a single worker (safe with the wizard's default\n#    SQLite + ChromaDB-persistent + NetworkX backends).\npython main.py\n```\n\nOpen [http:\u002F\u002Flocalhost:8000](http:\u002F\u002Flocalhost:8000) — the web UI is served automatically.\n\n> **Note:** Document ingestion involves heavy LLM calls (tree building, KG extraction, embedding). For a responsive UI under concurrent ingestion, scale to multiple workers — but `--workers >1` requires multi-process-safe backends (PostgreSQL + Neo4j + a non-persistent ChromaDB \u002F Qdrant \u002F Milvus \u002F Weaviate \u002F pgvector). Starting with `--workers >1` against single-process backends (SQLite, NetworkX, persistent ChromaDB) exits with code 2 to avoid silent data corruption.\n\n### Option B: Docker Deployment\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fdeeplethe\u002FForgeRAG.git\ncd ForgeRAG\n\npython scripts\u002Fdocker_setup.py   # Interactive wizard: pick provider, set keys, done\ndocker compose up -d             # PostgreSQL + pgvector + ForgeRAG, ready to go\n```\n\nOpen [http:\u002F\u002Flocalhost:8000](http:\u002F\u002Flocalhost:8000). See [Deployment Guide](docs\u002Fdeployment.md) for details.\n\n> **Tip:** We strongly recommend enabling **MinerU** — it significantly improves document structure parsing accuracy, especially for PDFs with complex layouts, tables, and formulas. Enable it in the web UI settings after startup.\n\n### Supported Backends\n\n| Component | Options |\n|-----------|---------|\n| **PDF Parser** | One explicit choice: `pymupdf` (fast, default) \u002F `mineru` (layout-aware, tables\u002Fformulas) \u002F `mineru-vlm` (vision-language for scanned & complex layouts) |\n| **Relational DB** | SQLite (default), PostgreSQL, MySQL |\n| **Vector Store** | ChromaDB (default), pgvector (PostgreSQL), Qdrant, Milvus, Weaviate |\n| **Blob Storage** | Local filesystem (default), Amazon S3, Alibaba OSS |\n| **Graph Store** | NetworkX in-memory (default), Neo4j |\n| **LLM \u002F Embeddings** | Any [LiteLLM](https:\u002F\u002Fdocs.litellm.ai\u002Fdocs\u002Fproviders)-supported provider: OpenAI, Azure, Anthropic, Ollama, DeepSeek, Cohere, etc. |\n\n### CLI Options\n\n| Flag | Default | Description |\n|------|---------|-------------|\n| `--config` | auto-detect | Path to `forgerag.yaml` |\n| `--host` | `0.0.0.0` | Bind address (or `$FORGERAG_HOST`) |\n| `--port` | `8000` | Bind port (or `$FORGERAG_PORT`) |\n| `--reload` | off | Hot-reload for development |\n| `--workers` | `1` | Uvicorn workers. Values > 1 require multi-process-safe backends (PostgreSQL + Neo4j + non-persistent vector store); startup exits 2 otherwise. |\n\n## Architecture\n\nThe diagram above shows the complete data flow. For detailed pipeline documentation with per-node annotations, see [Architecture Overview](docs\u002Farchitecture.md).\n\n## API\n\nThe REST API is available at `\u002Fapi\u002Fv1\u002F`. Interactive docs:\n\n- Swagger UI: [http:\u002F\u002Flocalhost:8000\u002Fdocs](http:\u002F\u002Flocalhost:8000\u002Fdocs)\n- ReDoc: [http:\u002F\u002Flocalhost:8000\u002Fredoc](http:\u002F\u002Flocalhost:8000\u002Fredoc)\n\nKey endpoints:\n\n| Endpoint | Description |\n|----------|-------------|\n| `POST \u002Fapi\u002Fv1\u002Fquery` | Ask a question (streaming SSE or sync) — accepts `path_filter` + `overrides` for per-request tuning |\n| `POST \u002Fapi\u002Fv1\u002Fdocuments\u002Fupload-and-ingest` | Upload into a folder (multipart; `folder_path` form field) |\n| `GET  \u002Fapi\u002Fv1\u002Fdocuments?path_filter=…&recursive=…` | List docs under a folder |\n| `GET  \u002Fapi\u002Fv1\u002Fdocuments\u002F{id}\u002Ftree` | Document hierarchical structure |\n| `GET  \u002Fapi\u002Fv1\u002Fgraph` | Knowledge graph visualization |\n| `GET  \u002Fapi\u002Fv1\u002Fsettings` | Read-only snapshot of effective cfg (yaml is authoritative) |\n\n## Documentation\n\n- **[Getting Started](docs\u002Fgetting-started.md)** — Installation, first document, step-by-step guide\n- **[Architecture Overview](docs\u002Farchitecture.md)** — How ingestion, retrieval, and answering pipelines work\n- **[Configuration Reference](docs\u002Fconfiguration.md)** — Every config option with defaults and examples\n- **[API Reference](docs\u002Fapi-reference.md)** — REST API endpoints, request\u002Fresponse formats, SSE streaming\n- **[Deployment Guide](docs\u002Fdeployment.md)** — Docker deploy, production checklist, Nginx, Ollama\n- **[Development Guide](docs\u002Fdevelopment.md)** — Dev setup, testing, adding new backends\n- **[Auth & Sessions](docs\u002Fauth.md)** — Single-admin password + SK tokens, web management UI, CLI playbook\n\n## Project Structure\n\n```\nForgeRAG\u002F\n├── api\u002F              # FastAPI routes and schemas\n├── answering\u002F        # Answer generation pipeline\n├── config\u002F           # Pydantic configuration models\n├── embedder\u002F         # Embedding backends (LiteLLM, sentence-transformers)\n├── graph\u002F            # Knowledge graph stores (NetworkX, Neo4j)\n├── ingestion\u002F        # Document ingestion pipeline + format conversion\n├── parser\u002F           # PDF parsing, chunking, tree building\n├── persistence\u002F      # Database layer (relational, vector, blob)\n├── retrieval\u002F        # Retrieval pipeline (BM25, vector, tree, KG, merge)\n├── scripts\u002F          # CLI utilities (setup wizard, Docker setup, batch ingest)\n├── web\u002F              # Vue 3 frontend\n├── docs\u002F             # Detailed documentation\n├── main.py           # Application entry point\n└── forgerag.yaml     # Your local config (git-ignored)\n```\n\n## Roadmap\n\n- [ ] 🧪 More benchmarks against additional RAG systems and domains\n- [ ] 🔄 Scale to 1M+ documents · incremental indexing, async KG\n- [ ] 🌐 Multi-language retrieval · cross-lingual query and document support\n- [ ] 📦 Python SDK · `pip install forgerag-sdk`\n- [ ] 🛠️ Config panel hints & diagnostics · Missing provider warnings, validation feedback\n- [ ] ⚡ Performance optimization · Faster ingestion, query caching, async embedding\n\n## Contributing\n\nWe welcome contributions of all kinds — bug fixes, new features, documentation improvements, and more.\n\nPlease read our [Contributing Guide](CONTRIBUTING.md) before submitting a pull request.\n\n## Related Projects\n\n- [LightRAG](https:\u002F\u002Fgithub.com\u002FHKUDS\u002FLightRAG) — Graph-based RAG with dual-level (local + global) retrieval\n- [GraphRAG](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fgraphrag) — Microsoft's graph-powered RAG with community summaries\n- [PageIndex](https:\u002F\u002Fgithub.com\u002FVectifyAI\u002FPageIndex) — Reasoning-based vectorless retrieval\n\n## License\n\n[MIT License](LICENSE)\n","ForgeRAG 是一个生产就绪的结构感知推理检索增强生成（RAG）系统。它结合了BM25与向量搜索以快速定位候选区域，利用知识图谱进行跨文档的概念连接，并通过大语言模型树导航来精确识别关键段落，从而实现高效的多跳查询和精准引用。该工具特别适用于需要处理复杂文档结构、要求高准确性和低延迟响应的企业级应用环境，如大规模知识库管理、智能客服系统等场景。项目采用Python开发，遵循MIT许可协议，目前在GitHub上获得了658颗星，显示出其在社区中的受欢迎程度。",2,"2026-05-06 17:28:33","CREATED_QUERY"]