Back to articles
I got tired of writing 30 lines of LangChain boilerplate every time. So I published a fix.

I got tired of writing 30 lines of LangChain boilerplate every time. So I published a fix.

via Dev.to PythonAman Pandey

Every time I started a new project that needed RAG, I wrote the same 30 lines. Load documents. Split them. Embed them. Store them. Build a retriever. Wire up a prompt template. Build a chain. Handle the response format. Add reranking later when results were bad. Add GraphRAG even later when cross-document queries failed. Add a watchdog when the index went stale. Every single project. From scratch. Every time. I got tired of it. So I built ragbox-core and published it to PyPI. pip install ragbox-core from ragbox import RAGBox rag = RAGBox ( " ./docs " ) print ( rag . query ( " What is the vacation policy? " )) 3 lines. Everything else runs automatically. What "automatically" actually means When you point RAGBox at a folder, here's what runs without you touching it: Document parsing — PDFs, text files, PowerPoints, Python files with AST parsing. It figures out the file type and routes accordingly. Chunking — late chunking with context awareness, not naive 1000-token splits. The chunk bou

Continue reading on Dev.to Python

Opens in a new tab

Read Full Article
2 views

Related Articles