Build semantic search, question answering, and FastAPI-powered RAG applications in just a few lines of Python.
Project description
🚀 RagUp
Build semantic search, AI-powered question answering, and FastAPI APIs from your documents in just a few lines of Python.
RagUp is an opinionated Python library that lets you turn documents into searchable AI knowledge bases with almost no setup.
✨ Features
- 📄 Supports PDF, TXT and JSON documents
- 🧠 Local embeddings using Sentence Transformers
- 🔍 Semantic Search
- 🤖 AI-powered Question Answering (Gemini)
- ⚡ FastAPI server with automatic Swagger UI
- 💾 Persistent indexing (no re-indexing if nothing changes)
- 🐍 Simple Python API
📦 Installation
pip install ragup
⚡ Quick Start
from ragup import Document
doc = Document("policy.pdf")
# Build the index
doc.ragup()
# Semantic Search
results = doc.search(
"refund policy"
)
print(results)
# AI Question Answering
answer = doc.ask(
"What is the refund policy?",
api_key="YOUR_GEMINI_API_KEY"
)
print(answer)
# Launch FastAPI
doc.serve(
api_key="YOUR_GEMINI_API_KEY"
)
Open
http://localhost:8085/docs
to access the interactive Swagger UI.
📚 Supported Documents
| Format | Supported |
|---|---|
| ✅ | |
| TXT | ✅ |
| JSON | ✅ |
🔍 Semantic Search
results = doc.search(
"shipping charges",
top_k=3
)
Returns the most relevant chunks from your document.
🤖 AI Question Answering
answer = doc.ask(
"Summarize this document",
api_key="YOUR_GEMINI_API_KEY"
)
RagUp retrieves relevant chunks and asks Gemini to answer using only the document context.
🌐 FastAPI Server
doc.serve(
api_key="YOUR_GEMINI_API_KEY"
)
Available endpoints
POST /search
POST /ask
GET /health
GET /docs
If no API key is supplied,
doc.serve()
the /ask endpoint is automatically disabled.
💾 Persistent Indexing
The first time you call
doc.ragup()
RagUp creates a local index.
Subsequent calls reuse the cached index automatically if the document hasn't changed, making startup almost instantaneous.
🛣 Roadmap
v0.1.0
- ✅ PDF Support
- ✅ TXT Support
- ✅ JSON Support
- ✅ Semantic Search
- ✅ Gemini Question Answering
- ✅ FastAPI Server
- ✅ Persistent Indexing
Upcoming
- DOCX Support
- Markdown Support
- HTML Support
- Multi-document collections
- Multiple LLM providers
- Better chunking strategies
- CLI Support
🤝 Contributing
Contributions, feature requests and bug reports are welcome.
Feel free to open an issue or submit a pull request.
📄 License
MIT License
🧠 Built by the brain of Mehul Dewan. Powered by caffeine.
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 ragup-0.1.0.tar.gz.
File metadata
- Download URL: ragup-0.1.0.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcf46db122c9108c26a391e46a86fd66efa845535cbe4e7db7d85eaf8638cb8f
|
|
| MD5 |
3775c65a949723ae7152931beadbd6e1
|
|
| BLAKE2b-256 |
2edc64f7cd205acd6fd7ed1ec5ab7c100a50787f95e4e87d7bd2b23a64d82120
|
File details
Details for the file ragup-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ragup-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3bfbbaa11a8c532cf0afd8878862f794fb2c9153aacd97451f12dc075a302d2
|
|
| MD5 |
e738ac0bf7009d493f8596b184f7528f
|
|
| BLAKE2b-256 |
5a9f40301a42bc3b216e864df377d6c0433c94a91165661f4a1a93fbd19f4f6f
|