Metadata-Version: 2.4
Name: ragup
Version: 0.1.0
Summary: Build semantic search, question answering, and FastAPI-powered RAG applications in just a few lines of Python.
Author-email: Mehul Dewan <mehul.work.17@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/mehuldewan17/RagUp
Project-URL: Repository, https://github.com/mehuldewan17/RagUp
Project-URL: Issues, https://github.com/mehuldewan17/RagUp/issues
Keywords: rag,genai,llm,embeddings,semantic-search,vector-database,chromadb,fastapi,ai,python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pymupdf>=1.24.0
Requires-Dist: chromadb>=0.5.0
Requires-Dist: sentence-transformers>=3.0.0
Requires-Dist: fastapi>=0.115.0
Requires-Dist: uvicorn>=0.30.0
Requires-Dist: litellm>=1.40.0
Requires-Dist: pydantic>=2.8.0
Requires-Dist: numpy>=1.26.0
Requires-Dist: tqdm>=4.66.0
Requires-Dist: typing_extensions>=4.12.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: black>=24.0.0; extra == "dev"
Requires-Dist: isort>=5.13.0; extra == "dev"
Requires-Dist: mypy>=1.10.0; extra == "dev"
Dynamic: license-file

# 🚀 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

```bash
pip install ragup
```

---

## ⚡ Quick Start

```python
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 |
|---------|-----------|
| PDF | ✅ |
| TXT | ✅ |
| JSON | ✅ |

---

# 🔍 Semantic Search

```python
results = doc.search(
    "shipping charges",
    top_k=3
)
```

Returns the most relevant chunks from your document.

---

# 🤖 AI Question Answering

```python
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

```python
doc.serve(
    api_key="YOUR_GEMINI_API_KEY"
)
```

Available endpoints

```
POST /search
POST /ask
GET  /health
GET  /docs
```

If no API key is supplied,

```python
doc.serve()
```

the `/ask` endpoint is automatically disabled.

---

# 💾 Persistent Indexing

The first time you call

```python
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.
