QV-RAG
A simple and efficient RAG (Retrieval-Augmented Generation) engine for semantic search and document retrieval.
Note: This is an experimental project used for research and development. The engine is functional but will continue to evolve and improve over time.
Features
- Simple API: Easy-to-use interface for document management and querying
- Multiple Document Types: Support for text, markdown, HTML, and JSON files
- Smart Chunking: Intelligent text splitting with metadata preservation
- Semantic Search: Built-in semantic search using ChromaDB
- Metadata Support: Flexible metadata handling for better document organization
Installation
pip install qv-rag
Quick Start
from qv_rag.engine import RAGEngine
# Initialize the engine
engine = RAGEngine(
collection_name="my_docs",
chunk_size=1000,
chunk_overlap=200
)
# Add documents
engine.add_texts(["Python is a popular programming language."])
engine.add_file("document.md")
# Query documents
results = engine.query("What is Python?")
for result in results:
print(result['text'])
print(f"Score: {result['distance']}")
Usage Examples
Adding Documents
# Add text with metadata
engine.add_texts(
texts=["Document content"],
metadatas=[{"source": "manual", "category": "docs"}]
)
# Add a file
engine.add_file("document.md", metadata={"source": "file"})
Querying
# Simple query
results = engine.query("What is machine learning?")
# Query with filters
results = engine.query(
"What is Python?",
where={"category": "docs"},
top_k=3
)
Supported File Types
- Text files (
.txt) - Markdown files (
.md) - HTML files (
.html,.htm) - JSON files (
.json) - PDF files (
.pdf) --> must be further improved
License
MIT License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qv_rag-0.1.0.tar.gz
(130.4 kB
view details)
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 qv_rag-0.1.0.tar.gz.
File metadata
- Download URL: qv_rag-0.1.0.tar.gz
- Upload date:
- Size: 130.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc0bd2940945848dc8a7363d397bed8105b368615065effabcdbcbd3e80b28d3
|
|
| MD5 |
e946cb03ac3f0e73c3440c7b5a61cdd7
|
|
| BLAKE2b-256 |
9dcfa466dbadfd09160583effd215ed327216219e49d3227400e6b68d10db451
|
File details
Details for the file qv_rag-0.1.0-py3-none-any.whl.
File metadata
- Download URL: qv_rag-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42e3a8a8bc0a53c1f22024c77681865ce09c48e255657d30106bfc434094c391
|
|
| MD5 |
ee4a67dd667730ebdacda9477421dc5e
|
|
| BLAKE2b-256 |
b333041592589f187573d44fae362b1879df59284e57f237a501e3002e25bb62
|