{"slug": "show-hn-ragleap-rag-rag-engine-that-documents-what-it-doesn-t-do-yet", "title": "Show HN: Ragleap-RAG – RAG engine that documents what it doesn't do yet", "summary": "RagLeap has released RagLeap Core, an MIT-licensed, open-source RAG engine that powers its self-hosted AI business manager, allowing users to run a document-grounded chat system on their own infrastructure with their own keys. The engine provides persistent memory across channels, a dashboard for non-technical owners, and built-in voice AI, with no vendor lock-in. The project is honest about its early stage, with a roadmap reflecting the real state of the code.", "body_md": "**The open-source AI business manager. One AI, five channels, one memory.**\n\nRagLeap Core is the open-source engine behind RagLeap — a self-hosted RAG (retrieval-augmented generation) chat system that answers questions from your own documents, on your own server, with no vendor lock-in.\n\n[Quickstart](#quickstart) · [Docs](https://docs.ragleap.com) · [Website](https://ragleap.com) · [Hosted Version](https://ragleap.com)\n\nNot to be confused with— that's a separate, paid, license-gated self-hosted product (Free tier with a license key, up to Enterprise).`install.ragleap.com`\n\n`ragleap-core`\n\n(this repo) is MIT-licensed, completely free, and never requires a license key. If you cloned this repo, you're in the right place for a genuinely free, open-source RAG engine.\n\nMost open-source RAG projects give you a toolkit — you still have to build the app, wire up a UI, add memory, and connect every channel yourself. RagLeap Core gives you a working chat engine out of the box, and the full RagLeap platform turns it into an AI that actually operates a business.\n\n| Without RagLeap | With RagLeap |\n|---|---|\n| ❌ A different bot for your website, WhatsApp, and Telegram — none of them share memory | ✅ One AI across every channel, with memory that persists between them |\n| ❌ Your RAG chatbot forgets everything the moment a session ends | ✅ Persistent memory — facts and preferences carry across sessions and channels |\n| ❌ You're a developer, so you can wire up LangChain — but your team can't manage it | ✅ A real dashboard for non-technical owners: settings, analytics, team, billing |\n| ❌ Answering customer questions and running the business are two separate systems | ✅ Manager AI — an executive assistant that can see analytics, send emails, and manage settings by conversation |\n| ❌ Adding a phone line means integrating Twilio, STT, and TTS yourself | ✅ Voice AI is built in — real inbound calls, answered and routed automatically |\n| ❌ Automating a workflow means writing custom code per integration | ✅ n8n workflow automation triggered directly from any conversation |\n\nThis repo isn't a general-purpose RAG framework you assemble into something — it's the real, working engine that already powers a production AI business platform (see [What's in the hosted version](#whats-in-the-hosted-version-ragleapcom) below). The code here is honest about being early, but it's extracted from something that already works in the real world, not built as a demo.\n\nOpen-source AI agent projects like OpenClaw took off for a specific reason: people wanted an assistant that runs on **their own infrastructure**, with **their own keys**, answering from **the chat apps they already use** — not a black box hosted by someone else. That same principle is what RagLeap Core is built on for business AI specifically.\n\n**Your keys, your infrastructure, your data.** RagLeap Core never asks for a system API key. You bring your own Gemini key, you run your own PostgreSQL database, your documents never leave your server unless you choose the hosted version.\n\n**Chat is the interface, not a separate dashboard you have to learn.** The same way OpenClaw meets people on WhatsApp, Telegram, and Slack, RagLeap's full platform meets business owners on the channels they already use — WhatsApp, Telegram, Discord, and real phone calls — not a new app they have to check.\n\n**A real, working system — not an abstract framework.** This isn't a toolkit like LangChain where you assemble your own app from primitives. RagLeap Core is the actual chunking → embedding → retrieval → generation pipeline extracted from a production system that already answers real customer questions, at a company that already runs on it.\n\n**Built in public, honestly.** This repo says clearly what's done and what isn't. No inflated claims, no vaporware Quickstart commands that don't work yet — the Roadmap reflects the real state of the code, updated as it progresses.\n\nRagLeap Core is a document-grounded chat engine. Upload your documents, ask questions, get cited answers — self-hosted, on your own infrastructure, with your own API key.\n\nWhatsApp, Telegram, and Discord bots are included in this repo too — single-tenant, .env-configured channel adapters that answer from the same document knowledge base. It is the foundation of [RagLeap](https://ragleap.com), a hosted AI business manager that adds Voice calling, multi-tenancy, a persistent memory system, and an executive-assistant layer on top of this same core engine.\n\n**If RagLeap (hosted) is the business, RagLeap Core is the engine room.**\n\n- ✅ You want a self-hosted RAG chatbot with full control over your data\n- ✅ You want to understand exactly how document retrieval and citation works, not use a black box\n- ✅ You're comfortable running your own server and your own AI provider key\n- ✅ You want to contribute to or extend an open document-QA engine\n- ✅ You'd rather see the code than trust a vendor's word on data privacy\n\n| It's not... | It is... |\n|---|---|\n| A hosted product | Self-hosted software you run yourself |\n| Multi-tenant, with persistent cross-session memory | Single-tenant — one bot, one document set, per deployment |\n| A multi-tenant platform | WhatsApp/Telegram/Discord/Voice channel adapters included, single-tenant — multi-tenant routing lives in the hosted version |\n| A no-code SaaS dashboard | A codebase you deploy and configure |\n| Feature-complete with the hosted version | The foundational subset — see\n|\n\n📄 Document ingestion |\nUpload PDFs, text, and common document formats |\n🔍 RAG retrieval |\nVector search over your documents via pgvector |\n💬 Chat with citations |\nAnswers reference the source document, not a black box |\n🔌 Bring your own AI key |\nOpenAI, Gemini, Anthropic, or any OpenAI-compatible endpoint |\n🌐 Web chat widget |\nEmbed a chat widget on any website |\n🐳 Docker-based setup |\nOne-command local deployment |\n🕸️ Knowledge Graph (Neo4j) |\nEntity extraction and graph-boosted retrieval alongside vector search |\n🌍 Language detection |\nAuto-detects document and query language, applied across every channel |\n🔗 Integrations |\nConnect MySQL, PostgreSQL, MongoDB, REST APIs, Salesforce, HubSpot, Shopify, Google Sheets, Stripe |\n🔀 Hybrid search |\nCombines dense (vector) and sparse (full-text) retrieval via Reciprocal Rank Fusion |\n⚡ Streaming responses |\nAnswers stream token-by-token instead of waiting for the full response |\n🔁 Provider fallback |\nAutomatically retries with a backup LLM provider if the primary fails |\n💰 Token usage reporting |\nReal per-call token counts from the provider, plus context-size budget trimming |\n\nRagLeap Core is the foundation layer of the full RagLeap platform. Here's how it fits into the bigger picture:\n\n```\n+-------------------------------------------------------------+\n|                  RagLeap (Hosted Platform)                   |\n|                                                                |\n|  [locked] Manager AI — private executive assistant           |\n|  [locked] AI Employees — role-based persistent memory        |\n|  [locked] n8n Workflow Automation                            |\n|  [locked] Persistent Memory (cross-channel, cross-session)   |\n|  [locked] Multi-tenant Billing, Teams & Permissions           |\n|  [locked] Audit History / Compliance logging                 |\n|  [locked] Embed Widget Control Center (white-label)           |\n|  [locked] Managed hosting, backups, SLA, support              |\n|                                                                |\n|                       built on top of                        |\n+-------------------------------------------------------------+\n                          |\n+-------------------------------------------------------------+\n|              RagLeap Core (this repo, open)                  |\n|                                                                |\n|                      +----------------+                       |\n|                      |  Web Chat UI   |                       |\n|                      +-------+--------+                       |\n|                              |                                |\n|                      +-------v--------+                       |\n|                      |   Chat API     |                       |\n|                      +-------+--------+                       |\n|                              |                                |\n|        +---------------------+---------------------+          |\n|        |          |          |          |                    |\n|  +-----v----+ +---v-----+ +--v------+ +-v-------+             |\n|  | WhatsApp | |Telegram | | Discord | |  Voice  |             |\n|  +----------+ +---------+ +---------+ +---------+             |\n|        |          |          |          |                    |\n|        +---------------------+---------------------+          |\n|                              |                                |\n|        +---------------------+---------------------+          |\n|        |                     |                     |          |\n|  +-----v-----+        +------v------+       +------v------+   |\n|  |  Document |        |     RAG     |       | AI Provider |   |\n|  |  Ingest   |        |   Retrieve  |       |   Adapter   |   |\n|  +-----+-----+        +------+------+       +------+------+   |\n|        |                     |                     |          |\n|        +---------------------+---------------------+          |\n|                              |                                |\n|                  +-----------v-----------+                    |\n|                  |  PostgreSQL + pgvector |                    |\n|                  +-----------+-----------+                    |\n|                              |                                |\n|                  +-----------v-----------+                    |\n|                  |    Neo4j (Knowledge   |                    |\n|                  |         Graph)         |                    |\n|                  +------------------------+                    |\n+-------------------------------------------------------------+\n```\n\n**[locked]** = commercial/hosted-only feature, not included in this repository. See below for the full breakdown.\n\n```\nragleap-core/\n├── core/                  # RAG engine — chunking, embedding, retrieval, generation\n│   ├── chunker.py\n│   ├── embedding.py       # Gemini embeddings (gemini-embedding-001, 3072-dim)\n│   ├── retrieval.py       # pgvector cosine search\n│   ├── generation.py      # 19-provider BYOK generation (Gemini, OpenAI, Anthropic, etc.)\n│   ├── ingest.py          # chunk -> embed -> store pipeline\n│   ├── parsers.py         # PDF/DOCX/TXT text extraction\n│   └── api.py             # FastAPI app — /health, /upload, /chat, /webhook/*\n├── channels/              # Messaging + voice channel adapters\n│   ├── whatsapp/          # Twilio + Gupshup\n│   ├── telegram/\n│   ├── discord/\n│   └── voice/             # Twilio Media Streams, WebSocket server\n├── db/\n│   └── schema.sql         # documents + chunks tables, pgvector index\n├── examples/              # Runnable example scripts\n├── .github/workflows/     # CI: compile check, Docker build, smoke tests\n├── docker-compose.yml     # app + db + voice services\n└── Dockerfile\n```\n\nRagLeap Core covers document upload, retrieval, and web chat. The hosted platform builds a full AI business manager on top of it:\n\n| Area | What it adds |\n|---|---|\nManager AI |\nA private executive assistant for the owner — sees documents, analytics, team permissions, and database connections; can send emails, generate reports, and manage settings by conversation, reachable via Web, WhatsApp, Telegram, or phone call |\nAI Employees |\nSpecialized AI roles seeded per workspace, each with its own permanent memory, so support and sales conversations draw on different context automatically |\nVoice AI |\nReal inbound phone calls via Twilio — speech-to-text, RAG-grounded response, text-to-speech, with owner vs. customer call routing |\nMulti-channel bots (multi-tenant) |\nWhatsApp (Twilio or Gupshup), Telegram, and Discord — single-tenant versions are in this repo; the hosted version adds multi-tenancy, per-workspace routing, and shared config across channels |\nPersistent Memory |\nFacts and preferences that persist across sessions and channels, not just within a single conversation |\nAdvanced AI Settings |\nModel selection (Gemini/OpenAI/Claude), temperature tuning, bring-your-own-key per provider, and automatic failover across a fallback key pool |\nTeam Chat |\nInternal team messaging board per workspace, separate from customer-facing AI chat |\nn8n Workflows |\nTrigger no-code automations directly from a conversation, across every channel |\n222+ Languages |\nThis repo includes language detection (langdetect, ~55 languages) across all channels; the hosted platform extends this to 222+ languages with per-user persisted preferences |\nIntegrations & Database Connectors |\nThis repo includes 9 raw connectors (MySQL, PostgreSQL, MongoDB, REST API, Salesforce, HubSpot, Shopify, Google Sheets, Stripe) with on-demand sync; the hosted platform adds AI-suggested automations per channel and developer-level custom automation workflows on top |\nAnalytics Dashboard |\nPer-provider usage breakdown (OpenAI, Gemini, Claude), query volume, token costs, and daily trends |\nTeam & Billing |\nMulti-tenant workspaces, team member permissions, subscription plans, usage-based billing |\nAudit History |\nFull log of configuration changes — who changed what, and when |\nEmbed Control Center |\nWhite-label widget builder — Bubble, Fixed Panel, or Full Page embeds for any website |\nData Visibility Controls |\nPer-document and per-database Public/Private settings — control exactly what customer-facing bots see vs. what's reserved for Manager AI only |\nObservability & Hallucination Detection |\nBuilt-in monitoring layer that audits AI responses for accuracy and flags potential hallucinations |\nCloud or Self-Hosted deployment |\nRun the full platform as managed cloud (subscription) or self-hosted on your own server (one-time license) |\nManaged hosting |\nBackups, uptime SLA, and support — zero infrastructure to maintain |\n\nThis is the standard **open-core model** — the same approach used by projects like n8n, Supabase, and Cal.com: the engine is free and open, the managed/extended product is commercial.\n\n✅\n\nStatus: core pipeline verified working.Ingest -> embed -> retrieve -> generate runs end-to-end via Docker Compose, including a clean fresh-clone test. See the[Roadmap]for what's next (PDF/DOCX support, alternative BYOK providers).\n\n**Fastest way to try it** — one command checks Docker, clones the repo, and sets up `.env`\n\nfor you:\n\n```\ncurl -fsSL https://raw.githubusercontent.com/antonyrag/ragleap-core/main/install.sh | bash\n```\n\n(Windows users: run this in Git Bash, not Command Prompt or PowerShell.)\n\nThe script will pause after cloning and ask you to add your Gemini API key to `.env`\n\n— get a free one at [aistudio.google.com/apikey](https://aistudio.google.com/apikey), then re-run the same command.\n\n**Or, the manual way** — better if you want to read the code before running anything:\n\n```\ngit clone https://github.com/antonyrag/ragleap-core.git\ncd ragleap-core\ncp .env.example .env\n# add your Gemini API key to .env\ndocker compose up --build -d\n```\n\nRequirements: Docker, Docker Compose, an API key from OpenAI, Google Gemini, or Anthropic.\n\n**Try it in 30 seconds** — with the stack running, see [examples/](/antonyrag/ragleap-core/blob/main/examples) for two verified, runnable scripts:\n\n`examples/01_ingest_and_query.py`\n\n— upload a document and ask a question via the API`examples/02_test_channel_directly.py`\n\n— test the WhatsApp/Telegram/Discord answering logic without real bot credentials\n\nRagLeap Core is bring-your-own-key only there is no system-provided key for any provider. Set `LLM_PROVIDER`\n\nin `.env`\n\nto choose which one to use for the generation (chat) step. Embeddings currently always use Gemini (`gemini-embedding-001`\n\n), regardless of `LLM_PROVIDER`\n\n.\n\n`LLM_PROVIDER` value |\nRequired env vars | Notes |\n|---|---|---|\n`gemini` (default) |\n`GEMINI_API_KEY` |\nGet a key at aistudio.google.com/apikey |\n`anthropic` |\n`ANTHROPIC_API_KEY` , `ANTHROPIC_MODEL` (optional) |\nGet a key at console.anthropic.com |\n`openai` |\n`OPENAI_API_KEY` , `OPENAI_MODEL` |\n|\n`mistral` |\n`MISTRAL_API_KEY` , `MISTRAL_MODEL` |\n|\n`groq` |\n`GROQ_API_KEY` , `GROQ_MODEL` |\nFree tier available |\n`together` |\n`TOGETHER_API_KEY` , `TOGETHER_MODEL` |\n|\n`openrouter` |\n`OPENROUTER_API_KEY` , `OPENROUTER_MODEL` |\n|\n`ollama` |\n`OLLAMA_MODEL` (no API key needed) |\nSelf-hosted; requires Ollama running locally |\n`deepseek` |\n`DEEPSEEK_API_KEY` , `DEEPSEEK_MODEL` |\n|\n`xai` |\n`XAI_API_KEY` , `XAI_MODEL` |\n|\n`cohere` |\n`COHERE_API_KEY` , `COHERE_MODEL` |\n|\n`perplexity` |\n`PERPLEXITY_API_KEY` , `PERPLEXITY_MODEL` |\n|\n`qwen` |\n`QWEN_API_KEY` , `QWEN_MODEL` |\n|\n`moonshot` |\n`MOONSHOT_API_KEY` , `MOONSHOT_MODEL` |\n|\n`zhipu` |\n`ZHIPU_API_KEY` , `ZHIPU_MODEL` |\n|\n`yi` |\n`YI_API_KEY` , `YI_MODEL` |\n|\n`baidu` |\n`BAIDU_API_KEY` , `BAIDU_MODEL` |\n|\n`minimax` |\n`MINIMAX_API_KEY` , `MINIMAX_MODEL` |\n|\n`custom` |\n`CUSTOM_API_KEY` , `CUSTOM_MODEL` , `CUSTOM_BASE_URL` |\nAny OpenAI-compatible endpoint |\n\nExample, switching to Groq in `.env`\n\n:\n\n```\nLLM_PROVIDER=groq\nGROQ_API_KEY=your-groq-key\nGROQ_MODEL=llama-3.3-70b-versatile\n```\n\nRagLeap Core includes a real-time voice channel: Twilio Media Streams connects via WebSocket, your speech is transcribed with OpenAI Whisper, answered by the core RAG pipeline, and spoken back with OpenAI TTS. The voice-activity detection and echo-suppression logic is carried over from a production system tuned against real call traffic.\n\nRuns as a separate service on port 8765 (see `docker-compose.yml`\n\n), since\nTwilio's real-time audio protocol needs a raw WebSocket server, not an\nHTTP route.\n\n**Setup:**\n\n- Set\n`OPENAI_API_KEY`\n\nin`.env`\n\n(used for both Whisper STT and TTS in v1) - Optionally set\n`VOICE_BOT_NAME`\n\n,`VOICE_GREETING`\n\n,`VOICE_TTS_VOICE`\n\n- Point a Twilio phone number's\n`<Connect><Stream>`\n\nTwiML at`wss://your-domain.com:8765`\n\n**Honest status:** the WebSocket server, Twilio event protocol handling, and\nerror handling are verified working. The full Whisper/TTS round-trip has\nnot yet been live-tested end-to-end (requires OpenAI API credits). If you\ntry it and hit issues, please open one — this is exactly the kind of\nreal-world testing this project needs.\n\n**Known limitations, carried over from production and not yet fixed here:**\n\n- Only OpenAI Whisper (STT) and OpenAI TTS are supported in v1 — Deepgram and ElevenLabs (multi-language support) are good-first-issue candidates\n- Non-English TTS quality varies since OpenAI's TTS voices are English-tuned\n- Typical round-trip latency in production was 6-8 seconds\n\nRagLeap Core builds a lightweight entity co-occurrence graph alongside its vector index. When you ingest a document, entities (product names, acronyms, proper nouns) are extracted and linked in Neo4j. When you ask a question, the same extraction runs on your query, and any documents linked to matching entities get a similarity boost in retrieval — on top of, not instead of, normal pgvector search.\n\nRuns as a fourth Docker Compose service on ports `7475`\n\n/`7688`\n\n(remapped\nfrom Neo4j's defaults to avoid colliding with another Neo4j instance on the\nsame host). If Neo4j is unreachable or `NEO4J_PASSWORD`\n\nis unset, the graph\ndegrades gracefully — retrieval falls back to pure vector search, ingestion\nis unaffected.\n\n**Setup:**\n\n- Set\n`NEO4J_URI`\n\n,`NEO4J_USER`\n\n, and`NEO4J_PASSWORD`\n\nin`.env`\n\n(matching the`NEO4J_AUTH`\n\nvalue in`docker-compose.yml`\n\n) - Optionally set\n`DOMAIN_TERMS`\n\n— a comma-separated list of domain-specific terms to boost during extraction (e.g.`DOMAIN_TERMS=API,SDK,RAG`\n\n)\n\n**Honest status:** entity extraction, document graph writes, entity-based\ndocument lookup, and graph-boosted chat retrieval are all verified working\nend-to-end, including in CI (fresh build, real ingest, real query, real\ngraph lookup). The graph boost is currently a simple additive score bump,\nnot a full weighted re-ranker — a richer hybrid ranking system is a good\nnext step for anyone who wants to dig in.\n\n**Known limitations:**\n\n- Entity extraction is regex-based (CamelCase, acronyms, capitalized phrases, plus optional domain terms) — not a trained NER model, so it will miss some entities and occasionally include noise\n`search_related_entities()`\n\n(multi-hop graph traversal) is implemented but not yet wired into the retrieval pipeline — good-first-issue candidate for anyone wanting a project\n\nRagLeap Core auto-detects language during document ingestion (per chunk)\nand during chat (per query), using the `langdetect`\n\nlibrary plus\nscript-based heuristics for CJK, Hangul, and Kana text. Since every\nchannel (WhatsApp, Telegram, Discord, Voice, and the API directly)\nroutes through the same core chat pipeline, detection applies\nconsistently everywhere without per-channel wiring.\n\n**Setup:** works out of the box with no configuration. Optionally set\n`DEFAULT_LANGUAGE`\n\n(fallback when detection fails or text is too short),\n`LANGUAGE_DETECTION_CONFIDENCE_THRESHOLD`\n\n(default `0.7`\n\n), and\n`LANGUAGE_DETECTION_SUPPORTED_LANGUAGES`\n\n(comma-separated allowlist,\nblank = unrestricted).\n\n**Honest status:** verified working end-to-end — document-level\ndetection tested at high confidence (0.9999) on a real mixed-language\ndocument, and query-level detection confirmed working via both the API\nand CLI.\n\n**Known limitations:**\n\n`langdetect`\n\ncovers roughly 55 languages — noticeably fewer than the hosted platform's 222+, which layers additional detection and per-user language preferences on top- Short queries in closely-related languages can be misdetected (in testing, a short French query was detected as Italian) — this is an inherent limitation of statistical detection on short text, not specific to this port. A good-first-issue candidate for anyone wanting to improve short-query accuracy\n- Detection is one-way only: RagLeap Core detects the query's language and surfaces it, but does not yet steer the AI's response language to match — that's a reasonable next step for a contributor\n\nRagLeap Core connects to external databases and business tools, syncing per-user context to personalize RAG responses. Nine connectors are included: MySQL, PostgreSQL, MongoDB, generic REST APIs, Salesforce, HubSpot, Shopify, Google Sheets, and Stripe.\n\nEvery CRM/SaaS connector uses credentials you provide directly — a username/password, a private-app token, an admin API token, a service-account JSON file, or a secret key, depending on the service. None require registering an OAuth app; nothing here depends on RagLeap owning any third-party developer account.\n\nCredentials are encrypted at rest (Fernet/AES-128) before being stored.\n\n**Setup:**\n\n- Generate an encryption key:\n`python3 -c \"from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())\"`\n\n- Set\n`ADDON_ENCRYPTION_KEY`\n\nin`.env`\n\nto that value - Install the SDK for the connector(s) you want (each is optional — see\n`requirements.txt`\n\n) - Create a data source:\n`POST /integrations`\n\nwith`name`\n\n,`source_type`\n\n, and the relevant credential fields - Test it:\n`POST /integrations/{id}/test`\n\n- Sync it:\n`POST /integrations/{id}/sync`\n\n**Honest status:** verified end-to-end against a real public API —\nconnection testing, syncing, correct identifier-field matching, and\ncredential encryption (checked as actual ciphertext in the database,\nnot just assumed) all confirmed working.\n\n**Known limitations:**\n\n- 9 of the 18 source types listed in the hosted platform's UI have real connectors here. CSV Upload, Snowflake, BigQuery, WooCommerce, Airtable, Notion, Razorpay, Slack, and Gmail are good-first-issue candidates for anyone wanting to add one\n- Sync is on-demand only (\n`POST /integrations/{id}/sync`\n\n) — no scheduled background sync yet, though the schema tracks`sync_interval_minutes`\n\nfor a future Celery-beat-equivalent - Synced context isn't automatically injected into chat responses yet — each channel adapter would need to know its own user's identifier first, which is a reasonable next contribution\n\nBeyond the core RAG pipeline, `/chat`\n\n(and the underlying `core.chat.ask()`\n\n)\nsupport several controls aimed at production use: retrieval quality,\nresponse latency, provider reliability, and cost.\n\n**Hybrid search (dense + sparse).** By default, retrieval combines\npgvector cosine similarity with Postgres full-text search (`tsvector`\n\n/\n`GIN`\n\nindex), fused via Reciprocal Rank Fusion — catching both semantic\nmatches and exact keyword/identifier matches a pure embedding search can\nmiss. Pass `hybrid=false`\n\nto use dense-only retrieval instead (cheaper —\none query instead of two).\n\n**Streaming.** `POST /chat/stream`\n\nstreams the answer as it's generated\n(`text/plain`\n\n, chunked transfer) instead of waiting for the full response.\nImplemented natively per provider (Gemini, Anthropic, and OpenAI-compatible\neach have different streaming APIs — all three are real, not one stubbed).\n\n**Provider fallback.** Set `LLM_FALLBACK_PROVIDERS`\n\n(comma-separated) to\nautomatically retry with backup providers if the primary fails — a rate\nlimit, outage, or bad key on your primary provider doesn't have to mean a\nfailed request. Each fallback needs its own API key configured normally.\nStreaming can only fall back *before* any text has been sent to the\ncaller — a mid-stream failure surfaces as an error rather than silently\nswitching providers and confusing the output.\n\n**Generation controls.** `temperature`\n\n, `system_prompt`\n\n, and `max_tokens`\n\nare all real per-call parameters (not just env-var defaults) — build your\nown agent behavior on top of RagLeap's retrieval without forking the\nlibrary.\n\n**Token usage & context budget.** Every blocking `/chat`\n\ncall returns real\ntoken usage (`prompt_tokens`\n\n, `completion_tokens`\n\n, `total_tokens`\n\n) pulled\ndirectly from the provider's response — not an estimate. Retrieved\ncontext is also trimmed to `MAX_CONTEXT_CHARS`\n\n(default 12000, roughly\n4 characters per token for English text) before being sent, dropping the\nlowest-ranked chunks first, so you're not paying for more context than\nnecessary. Set `MAX_CONTEXT_CHARS=0`\n\nto disable trimming.\n\n**Honest status:** hybrid search's RRF fusion math verified correct\nagainst hand calculation. Streaming verified working end-to-end for the\ndefault provider. Provider fallback verified with a real broken-primary\ntest — deliberately invalid API key, confirmed fallback to a working\nsecondary provider with a correct answer. Token usage and context\ntrimming verified with real numbers: a 3-chunk retrieval trimmed to 1\nchunk under a tight budget reduced actual `prompt_tokens`\n\nby 38% on the\nsame live API.\n\n**Known limitations:**\n\n- Token usage reporting is not available for streaming responses — each provider's streaming API surfaces usage differently, and doing all three correctly is separate, not-yet-done work\n`MAX_CONTEXT_CHARS`\n\nis a character-count approximation (~4 chars/token for English), not an exact per-provider tokenizer count- Hybrid search hasn't been benchmarked for actual ranking-quality improvement on a multi-document corpus with genuinely conflicting dense vs. sparse rankings — only correctness (fusion math, tokenization of unusual identifiers) has been verified so far\n\n- Public repository created\n- Core RAG engine extracted and cleaned from production codebase\n- Standalone Docker Compose setup (no external Django project dependency)\n- Document ingestion module (28+ formats, not just PDF/TXT/DOCX)\n- Web chat widget\n- Bring-your-own-API-key support (19 providers)\n- WhatsApp, Telegram, Discord, and Voice channel adapters (single-tenant)\n- Knowledge Graph (Neo4j), language detection, database/CRM integrations\n- Contribution guide and good-first-issue labels\n- Community Discord\n\nSee [ROADMAP.md](/antonyrag/ragleap-core/blob/main/ROADMAP.md) for the full phase-by-phase history.\n\nRagLeap Core is working, tested, and open for contributions now. See [CONTRIBUTING.md](/antonyrag/ragleap-core/blob/main/CONTRIBUTING.md) for how to get started, and check the [good first issue](/antonyrag/ragleap-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label for scoped tasks.\n\n**Student, professor, or looking for a capstone/thesis project?** See [STUDENT_PROJECTS.md](/antonyrag/ragleap-core/blob/main/STUDENT_PROJECTS.md) for scoped project ideas at starter, semester, and research-grade levels.\n\n[GitHub Issues](/antonyrag/ragleap-core/issues)— bugs and feature requests[GitHub Discussions](/antonyrag/ragleap-core/discussions)— ideas and questions[ragleap.com](https://ragleap.com)— the hosted product\n\nMIT © 2026 RagLeap\n\n**\"could not translate host name 'db'\" error after a failed docker compose up:**\nIf your first\n\n`docker compose up`\n\nattempt fails (e.g. a port conflict on 5433 or 8000), a retry can sometimes leave the database container attached to a stale, orphaned Docker network. Fix:\n\n```\ndocker compose down\ndocker network prune -f\ndocker compose up --build -d\n```\n\n**Port 5433 or 8000 already in use:**\nAnother instance of this project (or something else) is using the port. Either stop it, or change the host-side port mapping in `docker-compose.yml`\n\n(the `\"5433:5432\"`\n\nand `\"8000:8000\"`\n\nlines) to something free.", "url": "https://wpnews.pro/news/show-hn-ragleap-rag-rag-engine-that-documents-what-it-doesn-t-do-yet", "canonical_source": "https://github.com/antonyrag/ragleap-core", "published_at": "2026-08-04 07:13:19+00:00", "updated_at": "2026-08-04 07:22:27.785289+00:00", "lang": "en", "topics": ["artificial-intelligence", "generative-ai", "ai-products", "ai-tools", "ai-infrastructure"], "entities": ["RagLeap", "RagLeap Core", "OpenClaw", "LangChain", "Gemini", "PostgreSQL", "Twilio", "n8n"], "alternates": {"html": "https://wpnews.pro/news/show-hn-ragleap-rag-rag-engine-that-documents-what-it-doesn-t-do-yet", "markdown": "https://wpnews.pro/news/show-hn-ragleap-rag-rag-engine-that-documents-what-it-doesn-t-do-yet.md", "text": "https://wpnews.pro/news/show-hn-ragleap-rag-rag-engine-that-documents-what-it-doesn-t-do-yet.txt", "jsonld": "https://wpnews.pro/news/show-hn-ragleap-rag-rag-engine-that-documents-what-it-doesn-t-do-yet.jsonld"}}