Docling → Chroma → Ollama: simple, RAG pipeline
Project description
📄 DocRAG LLM
check out my python library at pypi https://pypi.org/project/docrag-llm/#description
pip install docrag-llm
DocRAG LLM is a simple, Retrieval-Augmented Generation (RAG) pipeline.
It connects Docling (document parsing) → ChromaDB (vector store) → Ollama (local LLMs) into a single workflow, with both a CLI and a Python API.
✨ Features
- 🔍 Parse documents with Docling (PDF, DOCX, PPTX, HTML, etc.).
- 📑 Chunk text intelligently for retrieval.
- 🧠 Store embeddings in ChromaDB.
- 🤖 Answer questions using Ollama (default:
llama3.2:1b). - 🛡️ Designed for local execution (no cloud lock-in).
- 🖥️ Works both as a CLI tool and a Python library.
📦 Installation
pip install docrag-llm
Requirements
- Python 3.10+
- Ollama installed and running
- Models pulled locally:
ollama pull llama3.2:1b ollama pull nomic-embed-text
🚀 Quickstart (CLI)
Ingest a document into Chroma
python -m docrag.cli ingest https://arxiv.org/pdf/2508.20755 --persist ./.chroma --collection demo
--persist→ directory for Chroma DB (default:./.chroma)--collection→ logical collection name (default:demo)--embed→ embedding model (default:nomic-embed-text)
Ask a question (default LLM = llama3.2:1b)
python -m docrag.cli ask "Give a concise bullet summary of the paper's main contributions." --persist ./.chroma --collection demo
--llm→ LLM model to use (default:llama3.2:1b)--top-k→ number of chunks retrieved (default: 5)
Export parsed text
python -m docrag.cli export https://arxiv.org/pdf/2508.20755 --out-dir ./exports
Saves parsed text (Markdown/JSON).
CLI Help
python -m docrag.cli --help
python -m docrag.cli ingest --help
python -m docrag.cli ask --help
python -m docrag.cli export --help
🐍 Usage as a Python Library
from docrag import DocragSettings, RAGPipeline
# Configure pipeline
cfg = DocragSettings(
persist_path="./.chroma",
collection="demo",
embed_model="nomic-embed-text",
llm_model="llama3.2:1b",
)
pipeline = RAGPipeline(cfg)
# Ingest a document
n_chunks = pipeline.ingest("https://arxiv.org/pdf/2508.20755")
print(f"Ingested {n_chunks} chunks")
# Ask a question
answer = pipeline.ask("Give a concise bullet summary of the paper's main contributions.")
print(answer)
⚙️ Configuration
Both the Python API and CLI allow controlling:
persist_path→ path to Chroma DBcollection→ collection nameembed_model→ embedding model (Ollama tag)llm_model→ LLM model (default:llama3.2:1b)chunk_chars/chunk_overlap→ chunking granularity
📊 Roadmap
- Add
model-checkCLI command to list installed Ollama models. - Support multiple backends (Weaviate, Milvus).
- Add streaming output for long answers.
- Expand test suite with large document regression cases.
🤝 Contributing
PRs and issues welcome! Please run lint and tests before submitting:
ruff check .
pytest
📜 License
MIT License © 2025
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docrag_llm-0.1.20.tar.gz.
File metadata
- Download URL: docrag_llm-0.1.20.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae4d0a354b22f61e6a029168cfc6508e51ae00b7beac339d3ac7368326acafb5
|
|
| MD5 |
98fae905b7c1daeebf778ce4609b94ea
|
|
| BLAKE2b-256 |
e99b6ad13c943f26e17bbb4b8694d43537c111aeef976b0476a732f371636a96
|
File details
Details for the file docrag_llm-0.1.20-py3-none-any.whl.
File metadata
- Download URL: docrag_llm-0.1.20-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98ef843381f8fa6f3f25c1adb6d44cd34309e9c63483104d02e6f5e980374582
|
|
| MD5 |
60e720f074fc511014d1593a261e7feb
|
|
| BLAKE2b-256 |
b3afdd1e7dc09d856e70ffb9a71024925629c1179d552069223883b5c2252c8d
|