ragup 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,51 @@
1
+ """
2
+ Vector database manager.
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+ from .chroma import ChromaVectorDB
8
+
9
+
10
+ class VectorDBManager:
11
+ """
12
+ High-level interface for the vector database.
13
+ """
14
+
15
+ def __init__(self):
16
+
17
+ self.db = ChromaVectorDB()
18
+
19
+ def add(
20
+ self,
21
+ ids: list[str],
22
+ documents: list[str],
23
+ embeddings: list[list[float]],
24
+ metadatas: list[dict],
25
+ ) -> None:
26
+
27
+ self.db.add(
28
+ ids=ids,
29
+ documents=documents,
30
+ embeddings=embeddings,
31
+ metadatas=metadatas,
32
+ )
33
+
34
+ def search(
35
+ self,
36
+ embedding: list[float],
37
+ top_k: int = 5,
38
+ ) -> dict:
39
+
40
+ return self.db.search(
41
+ embedding,
42
+ top_k,
43
+ )
44
+
45
+ def count(self) -> int:
46
+
47
+ return self.db.count()
48
+
49
+ def reset(self) -> None:
50
+
51
+ self.db.reset()
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.4
2
+ Name: ragup
3
+ Version: 0.1.0
4
+ Summary: Build semantic search, question answering, and FastAPI-powered RAG applications in just a few lines of Python.
5
+ Author-email: Mehul Dewan <mehul.work.17@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/mehuldewan17/RagUp
8
+ Project-URL: Repository, https://github.com/mehuldewan17/RagUp
9
+ Project-URL: Issues, https://github.com/mehuldewan17/RagUp/issues
10
+ Keywords: rag,genai,llm,embeddings,semantic-search,vector-database,chromadb,fastapi,ai,python
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Topic :: Software Development :: Libraries
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: pymupdf>=1.24.0
24
+ Requires-Dist: chromadb>=0.5.0
25
+ Requires-Dist: sentence-transformers>=3.0.0
26
+ Requires-Dist: fastapi>=0.115.0
27
+ Requires-Dist: uvicorn>=0.30.0
28
+ Requires-Dist: litellm>=1.40.0
29
+ Requires-Dist: pydantic>=2.8.0
30
+ Requires-Dist: numpy>=1.26.0
31
+ Requires-Dist: tqdm>=4.66.0
32
+ Requires-Dist: typing_extensions>=4.12.0
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
35
+ Requires-Dist: black>=24.0.0; extra == "dev"
36
+ Requires-Dist: isort>=5.13.0; extra == "dev"
37
+ Requires-Dist: mypy>=1.10.0; extra == "dev"
38
+ Dynamic: license-file
39
+
40
+ # 🚀 RagUp
41
+
42
+ > Build semantic search, AI-powered question answering, and FastAPI APIs from your documents in just a few lines of Python.
43
+
44
+ RagUp is an opinionated Python library that lets you turn documents into searchable AI knowledge bases with almost no setup.
45
+
46
+ ---
47
+
48
+ ## ✨ Features
49
+
50
+ - 📄 Supports PDF, TXT and JSON documents
51
+ - 🧠 Local embeddings using Sentence Transformers
52
+ - 🔍 Semantic Search
53
+ - 🤖 AI-powered Question Answering (Gemini)
54
+ - ⚡ FastAPI server with automatic Swagger UI
55
+ - 💾 Persistent indexing (no re-indexing if nothing changes)
56
+ - 🐍 Simple Python API
57
+
58
+ ---
59
+
60
+ ## 📦 Installation
61
+
62
+ ```bash
63
+ pip install ragup
64
+ ```
65
+
66
+ ---
67
+
68
+ ## ⚡ Quick Start
69
+
70
+ ```python
71
+ from ragup import Document
72
+
73
+ doc = Document("policy.pdf")
74
+
75
+ # Build the index
76
+ doc.ragup()
77
+
78
+ # Semantic Search
79
+ results = doc.search(
80
+ "refund policy"
81
+ )
82
+
83
+ print(results)
84
+
85
+ # AI Question Answering
86
+ answer = doc.ask(
87
+ "What is the refund policy?",
88
+ api_key="YOUR_GEMINI_API_KEY"
89
+ )
90
+
91
+ print(answer)
92
+
93
+ # Launch FastAPI
94
+ doc.serve(
95
+ api_key="YOUR_GEMINI_API_KEY"
96
+ )
97
+ ```
98
+
99
+ Open
100
+
101
+ ```
102
+ http://localhost:8085/docs
103
+ ```
104
+
105
+ to access the interactive Swagger UI.
106
+
107
+ ---
108
+
109
+ # 📚 Supported Documents
110
+
111
+ | Format | Supported |
112
+ |---------|-----------|
113
+ | PDF | ✅ |
114
+ | TXT | ✅ |
115
+ | JSON | ✅ |
116
+
117
+ ---
118
+
119
+ # 🔍 Semantic Search
120
+
121
+ ```python
122
+ results = doc.search(
123
+ "shipping charges",
124
+ top_k=3
125
+ )
126
+ ```
127
+
128
+ Returns the most relevant chunks from your document.
129
+
130
+ ---
131
+
132
+ # 🤖 AI Question Answering
133
+
134
+ ```python
135
+ answer = doc.ask(
136
+ "Summarize this document",
137
+ api_key="YOUR_GEMINI_API_KEY"
138
+ )
139
+ ```
140
+
141
+ RagUp retrieves relevant chunks and asks Gemini to answer using only the document context.
142
+
143
+ ---
144
+
145
+ # 🌐 FastAPI Server
146
+
147
+ ```python
148
+ doc.serve(
149
+ api_key="YOUR_GEMINI_API_KEY"
150
+ )
151
+ ```
152
+
153
+ Available endpoints
154
+
155
+ ```
156
+ POST /search
157
+ POST /ask
158
+ GET /health
159
+ GET /docs
160
+ ```
161
+
162
+ If no API key is supplied,
163
+
164
+ ```python
165
+ doc.serve()
166
+ ```
167
+
168
+ the `/ask` endpoint is automatically disabled.
169
+
170
+ ---
171
+
172
+ # 💾 Persistent Indexing
173
+
174
+ The first time you call
175
+
176
+ ```python
177
+ doc.ragup()
178
+ ```
179
+
180
+ RagUp creates a local index.
181
+
182
+ Subsequent calls reuse the cached index automatically if the document hasn't changed, making startup almost instantaneous.
183
+
184
+ ---
185
+
186
+ # 🛣 Roadmap
187
+
188
+ ### v0.1.0
189
+
190
+ - ✅ PDF Support
191
+ - ✅ TXT Support
192
+ - ✅ JSON Support
193
+ - ✅ Semantic Search
194
+ - ✅ Gemini Question Answering
195
+ - ✅ FastAPI Server
196
+ - ✅ Persistent Indexing
197
+
198
+ ### Upcoming
199
+
200
+ - DOCX Support
201
+ - Markdown Support
202
+ - HTML Support
203
+ - Multi-document collections
204
+ - Multiple LLM providers
205
+ - Better chunking strategies
206
+ - CLI Support
207
+
208
+ ---
209
+
210
+ # 🤝 Contributing
211
+
212
+ Contributions, feature requests and bug reports are welcome.
213
+
214
+ Feel free to open an issue or submit a pull request.
215
+
216
+ ---
217
+
218
+ # 📄 License
219
+
220
+ MIT License
221
+
222
+ ---
223
+
224
+ 🧠 Built by the brain of **Mehul Dewan**. Powered by caffeine.
@@ -0,0 +1,39 @@
1
+ ragup/__init__.py,sha256=nBoz1q8tmIVkqtqw_sFnC3D4rz_UN8asfvgyhnFqDKM,95
2
+ ragup/config.py,sha256=EDa0RyhlbcMU785cOuPC-QJ8FxsGqJg45gT55f5TiOk,1027
3
+ ragup/constants.py,sha256=H2LqakDvJCf_iwxGutFNvdJPGsP7FhezSojz1b-Tx4E,1596
4
+ ragup/exceptions.py,sha256=DpyFgSbneI6Jy0r2t_xlv1VfcPiYWzE5KBVO9uGXDe0,1012
5
+ ragup/api/__init__.py,sha256=nOSjAcDcruQfp3kVTRiUOcAi5pEzJWPIhH_dcgboZX0,69
6
+ ragup/api/routes.py,sha256=1NZLmvbXxWvRojNj8PKDj-TD9qE1wufWDnKVizNq9nE,82
7
+ ragup/api/schemas.py,sha256=A2g93rZ3ViesFkTdyVUn_NqTAuP8DLkiwIzHQEM3lRo,214
8
+ ragup/api/server.py,sha256=eelq-nKVyIPaUV1_46qrXXEOH-wIP8yytkl27VIewsQ,1582
9
+ ragup/chunking/__init__.py,sha256=2jOrifoGAzBULxu_hciCfkSm6MilXY1CBSjNBeWlCp0,137
10
+ ragup/chunking/base.py,sha256=Xnltm1LtyqfNWbV9Q6r7OF7jtCEN4x5A2gnF3jmmtMY,670
11
+ ragup/chunking/recursive.py,sha256=FNOhx-T2b_YL7VAfM69KkKoS6et5bqgFqHDBlPucISQ,1175
12
+ ragup/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ ragup/core/document.py,sha256=8hRG5kmcTZJhBaHUky6642Mjwg4abVhSFXpFijB-tw8,6295
14
+ ragup/embeddings/__init__.py,sha256=9PPb3OfLw8mf6j42oEh2HYA0lVtTM9qrFCowFVp-45M,96
15
+ ragup/embeddings/embedder.py,sha256=i1EDamvsD1wJbf9uU_5vcVT_VorfRUWaQqMVx-d3Ba0,1241
16
+ ragup/embeddings/models.py,sha256=DKY1GrNB8DBCPyUah6nSuE2tGcqD-FUdXPOg_SEAo6U,510
17
+ ragup/llm/__init__.py,sha256=MJOsNwWUpkMQVTWQvplZLYD5nX1vMsL0ER3Xf_FIv84,102
18
+ ragup/llm/answer.py,sha256=9cv7TFcVEpWu69MpFwZSJYrE_ZBuMuCHmnT9-UbNki0,1096
19
+ ragup/llm/prompt.py,sha256=6XksQLXkz2lUDcixKJpKoNm3QycJzFoq8QjY-DKfUxU,601
20
+ ragup/loaders/__init__.py,sha256=-DFEqDRlEFg_gpfHkFXY4as2M99PC0KIF6Xyty5UM0A,1133
21
+ ragup/loaders/base.py,sha256=ENKiBj6a51TDtP0oKDe-kQK-Vj2vNVblpj5LNsf_oqU,649
22
+ ragup/loaders/json_loader.py,sha256=q8zsm842tOjaKZiXdI2CM7bYKHORKeZBPOTOCTIqVx0,968
23
+ ragup/loaders/pdf_loader.py,sha256=pIAx4KmerlAS0AiatZOVEVA4H60myQnDYFF9jA9gHUo,841
24
+ ragup/loaders/txt_loader.py,sha256=-j12iVNVzzvmcLEu9wGq-2HeLW01fdHGJiHdtH445oI,1023
25
+ ragup/retrieval/__init__.py,sha256=BTiFFO3gUW5GmEJ7pG0LLoFUeC9DnHVDTv1IYqCTbyQ,172
26
+ ragup/retrieval/retriever.py,sha256=88hZ_6duJBzDZ441uoPA6UAGKJptQ90biE3y-tn477w,777
27
+ ragup/retrieval/search.py,sha256=EKoa52H2QfExXwvfiGOt_6PJbee7nP56l45rDrUh9kw,1175
28
+ ragup/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
+ ragup/utils/helpers.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
+ ragup/utils/logger.py,sha256=cTZFgtjxjCzvblSbC0RMtLmfT2lY0dQeV4ZqZ7Gsn5c,806
31
+ ragup/utils/validators.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
+ ragup/vectordb/__init__.py,sha256=nUVGsjSXoWlOabwRRLYXDD82CUmpxawNDGSz_sMMjd4,115
33
+ ragup/vectordb/chroma.py,sha256=oZbZIhM2ubXA43Pb8cpXPKvSYahrPfdpkg22C5BSXP0,2214
34
+ ragup/vectordb/manager.py,sha256=E9az_8bnach3_Sgu1R5mUepgEEQ6kwolA0c2FX8vY80,929
35
+ ragup-0.1.0.dist-info/licenses/LICENSE,sha256=3YOjD-Mi681Le2UzX0rqyOuQPRlxAsDmdoTSeJ4apqg,1087
36
+ ragup-0.1.0.dist-info/METADATA,sha256=Dm9wk8fHHBJIrlUpzY2K9khqhVefBgnGwNVK_XT42o0,4590
37
+ ragup-0.1.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
38
+ ragup-0.1.0.dist-info/top_level.txt,sha256=VABr0T6Jg-TCX85RHFPaZtuswPRX42YkShbt0uSXMvo,6
39
+ ragup-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (83.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mehul Dewan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ ragup