{"by":"init0","descendants":6,"id":46142050,"kids":[46144875,46181000,46145936,46146530,46150133,46142051],"score":41,"text":"Got tired of wiring up vector stores, embedding models, and chunking logic every time I needed RAG. So I built piragi.<p><pre><code>  from piragi import Ragi\n\n  kb = Ragi(\\[&quot;.&#x2F;docs&quot;, &quot;.&#x2F;code&#x2F;\\*\\*&#x2F;\\*.py&quot;, &quot;https:&#x2F;&#x2F;api.example.com&#x2F;docs&quot;\\])\n\n  answer = kb.ask(&quot;How do I deploy this?&quot;)\n</code></pre>\nThat&#x27;s the entire setup. No API keys required - runs on Ollama + sentence-transformers locally.<p>What it does:<p><pre><code>  - All formats - PDF, Word, Excel, Markdown, code, URLs, images, audio\n\n  - Auto-updates - watches sources, refreshes in background, zero query latency\n\n  - Citations - every answer includes sources\n\n  - Advanced retrieval - HyDE, hybrid search (BM25 + vector), cross-encoder reranking\n\n  - Smart chunking - semantic, contextual, hierarchical strategies\n\n  - OpenAI compatible - swap in GPT&#x2F;Claude whenever you want\n</code></pre>\nQuick examples:<p><pre><code>  # Filter by metadata\n  answer = kb.filter(file_type=&quot;pdf&quot;).ask(&quot;What&#x27;s in the contracts?&quot;)\n\n  #Enable advanced retrieval\n\n    kb = Ragi(&quot;.&#x2F;docs&quot;, config={\n     &quot;retrieval&quot;: {\n        &quot;use_hyde&quot;: True,\n        &quot;use_hybrid_search&quot;: True,\n        &quot;use_cross_encoder&quot;: True\n     }\n   })\n\n\n  # Use OpenAI instead  \n  kb = Ragi(&quot;.&#x2F;docs&quot;, config={&quot;llm&quot;: {&quot;model&quot;: &quot;gpt-4o-mini&quot;, &quot;api_key&quot;: &quot;sk-...&quot;}})\n</code></pre>\nInstall:<p><pre><code>  pip install piragi\n  PyPI: https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;piragi&#x2F;\n</code></pre>\nWould love feedback. What&#x27;s missing? What would make this actually useful for your projects?","time":1764806627,"title":"Show HN: RAG in 3 Lines of Python","type":"story","url":"https://pypi.org/project/piragi/"}