{"id":51224825,"url":"https://github.com/saagpatel/rag-knowledge-base","last_synced_at":"2026-06-28T10:03:14.586Z","repository":{"id":363772223,"uuid":"1264848309","full_name":"saagpatel/rag-knowledge-base","owner":"saagpatel","description":"Local-first RAG knowledge base","archived":false,"fork":false,"pushed_at":"2026-06-10T08:36:48.000Z","size":474,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-10T10:16:31.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saagpatel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-10T08:29:17.000Z","updated_at":"2026-06-10T08:33:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/saagpatel/rag-knowledge-base","commit_stats":null,"previous_names":["saagpatel/rag-knowledge-base"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/saagpatel/rag-knowledge-base","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saagpatel%2Frag-knowledge-base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saagpatel%2Frag-knowledge-base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saagpatel%2Frag-knowledge-base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saagpatel%2Frag-knowledge-base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saagpatel","download_url":"https://codeload.github.com/saagpatel/rag-knowledge-base/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saagpatel%2Frag-knowledge-base/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34884278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-28T10:03:13.591Z","updated_at":"2026-06-28T10:03:14.579Z","avatar_url":"https://github.com/saagpatel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RAG Knowledge Base\n\nA 100% local, production-grade Retrieval-Augmented Generation system. Ingest documents, generate embeddings, and query your knowledge base with semantic search and AI-powered Q\u0026A — all running on your machine with zero cloud dependencies.\n\n## Features\n\n- **Multi-format ingestion** — Markdown, PDF, code (Python, JS, TS, Java, etc.), HTML, JSON, YAML, CSV, plain text\n- **Hybrid search** — Dense vector search + BM25 sparse search with Reciprocal Rank Fusion\n- **AI-powered Q\u0026A** — Ask questions and get answers with source citations\n- **Optional reranking** — BGE-reranker-v2-m3 for improved result relevance\n- **4 interfaces** — REST API, CLI, React web dashboard, MCP server for Claude Code\n- **Collection isolation** — Organize documents into separate searchable collections\n- **Background ingestion** — Async directory ingest with job tracking\n- **Query analytics** — Latency percentiles, query history, interface breakdowns\n\n## Architecture\n\n```\nCLI / REST API / Web UI / MCP Server\n              |\n         Core Engine\n              |\n  +--------+----------+-----------+\n  |Ingest  | Retrieve | Generate  |\n  |loaders | dense    | prompts   |\n  |chunkers| sparse   | Ollama    |\n  |embedder| hybrid   | streaming |\n  +---+----+----+-----+-----+----+\n      |         |            |\n  Qdrant    SQLite        Ollama\n  (vectors) (metadata)   (LLM + embeddings)\n```\n\n## Prerequisites\n\n- **Python 3.12+** with [uv](https://docs.astral.sh/uv/)\n- **Docker** (for Qdrant vector database)\n- **Ollama** with models pulled:\n  ```bash\n  ollama pull nomic-embed-text   # embeddings (required)\n  ollama pull mistral:7b          # generation (required for Q\u0026A)\n  ```\n- **Node.js 20+** (only for web UI development)\n\n## Quick Start\n\n### Development\n\n```bash\n# 1. Clone and install\ngit clone \u003crepo-url\u003e \u0026\u0026 cd rag-knowledge-base\nuv sync\n\n# 2. Start Qdrant\ndocker compose up -d\n\n# 3. Initialize database\nmake init-db\n\n# 4. Start the API server\nmake dev\n\n# 5. (Optional) Start the web dashboard\nmake dev-web\n```\n\nThe API is available at `http://127.0.0.1:8000/api/docs` (Swagger UI).\nThe web dashboard runs at `http://127.0.0.1:5173`.\n\n### Production (Docker)\n\n```bash\n# Build and start the full stack (API + Qdrant + Nginx)\nmake prod-up\n\n# Access at http://127.0.0.1:80\n```\n\n### Ingest your first documents\n\n```bash\n# Via CLI\nuv run rag ingest /path/to/docs -c my-collection\n\n# Via API\ncurl -X POST http://127.0.0.1:8000/api/ingest \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"path\": \"/path/to/docs\", \"collection\": \"my-collection\"}'\n```\n\n### Search and ask\n\n```bash\n# Search\nuv run rag search \"How does authentication work?\" -c my-collection\n\n# Ask a question\nuv run rag ask \"Explain the authentication flow\" -c my-collection\n\n# Interactive search\nuv run rag search -i -c my-collection\n```\n\n## Documentation\n\n| Document | Description |\n|----------|-------------|\n| [Architecture](docs/ARCHITECTURE.md) | System design, data flow, component responsibilities |\n| [Configuration](docs/CONFIGURATION.md) | Full config.yaml reference + environment variables |\n| [API Reference](docs/API.md) | All 16 REST endpoints with curl examples |\n| [CLI Reference](docs/CLI.md) | All commands, options, and examples |\n| [MCP Setup](docs/MCP-SETUP.md) | Claude Code integration guide |\n| [Deployment](docs/DEPLOYMENT.md) | Production Docker setup + backup/restore |\n| [Troubleshooting](docs/TROUBLESHOOTING.md) | Common issues and solutions |\n\n## Tech Stack\n\n| Component | Technology |\n|-----------|-----------|\n| Language | Python 3.12 |\n| API | FastAPI 0.115+ |\n| Vector DB | Qdrant 1.13+ (Docker ARM64) |\n| Metadata DB | SQLite via aiosqlite |\n| Embeddings | Ollama + nomic-embed-text (768-dim) |\n| Generation | Ollama + mistral:7b |\n| Reranker | BAAI/bge-reranker-v2-m3 (optional) |\n| Web UI | React 19 + Vite + Tailwind CSS |\n| CLI | Click 8.1+ |\n| MCP | FastMCP 2.0+ |\n\n## Development\n\n```bash\nmake test              # Run all tests\nmake test-integration  # Run integration tests (requires Qdrant + Ollama)\nmake lint              # Ruff linter\nmake format            # Black + isort\nmake type-check        # mypy strict mode\nmake check             # lint + type-check + test (not format)\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaagpatel%2Frag-knowledge-base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaagpatel%2Frag-knowledge-base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaagpatel%2Frag-knowledge-base/lists"}