Unified retrieval module for RAG system with multiple vector database support
Project description
Retriever
Unified retrieval module for RAG system with support for multiple vector databases.
Features
- Multiple vector database backends: Qdrant, ChromaDB, Milvus
- Filename search: Separate collection for efficient filename-based search
- Context enrichment: Fetch neighboring chunks for better context
- Category filtering: Filter results by accessible categories
- Unified interface: Single API for all vector stores
Installation
poetry add donkit-retriever
Usage
Basic Setup
from donkit.retriever import create_vectorstore_service, RetrievalConfig
from langchain.embeddings import OpenAIEmbeddings
# Configure retrieval options
config = RetrievalConfig(
vector_database="qdrant",
retriever_options={
"filename_search": True,
"partial_search": True,
"max_retrieved_docs": 10,
}
)
# Create service
embeddings = OpenAIEmbeddings()
service = create_vectorstore_service(
db_type="qdrant",
embeddings=embeddings,
config=config,
collection_name="my_collection",
database_uri="http://localhost:6333",
)
# Search documents
documents = await service.search_documents(
query="What is RAG?",
k=5
)
Supported Vector Databases
Qdrant
service = create_vectorstore_service(
db_type="qdrant",
embeddings=embeddings,
config=config,
database_uri="http://localhost:6333",
)
ChromaDB
service = create_vectorstore_service(
db_type="chroma",
embeddings=embeddings,
config=config,
database_uri="http://localhost:8000",
)
Milvus
service = create_vectorstore_service(
db_type="milvus",
embeddings=embeddings,
config=config,
database_uri="http://localhost:19530",
)
Configuration Options
from donkit.retriever import RetrievalConfig, RetrieverOptions
config = RetrievalConfig(
vector_database="qdrant", # qdrant | chroma | milvus
retriever_options=RetrieverOptions(
filename_search=True, # Enable filename-based search
partial_search=True, # Fetch neighboring chunks
max_retrieved_docs=10, # Max documents to retrieve
),
ranker="http://ranker-service:8000", # Optional reranker URL
)
Architecture
VectorstoreModule
Each database has its own module implementing VectorstoreModuleAbstract:
QdrantVectorstoreModuleChromaVectorstoreModuleMilvusVectorstoreModule
VectorstoreService
Orchestrates search operations:
- Filename search (if enabled)
- Vector search
- Neighbor fetching (if partial_search enabled)
- Document combination and deduplication
Development
# Install dependencies
poetry install
# Run tests
poetry run pytest
# Run linter
poetry run ruff check .
License
Proprietary
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
donkit_retriever-0.1.9.tar.gz
(13.3 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 donkit_retriever-0.1.9.tar.gz.
File metadata
- Download URL: donkit_retriever-0.1.9.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.13.12 Darwin/25.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1550fcad30000164d6a37e05ffeece02aba9e8e5ab67102bfc156b05cabbd738
|
|
| MD5 |
4bc8888450a2a9dd630271d33ddb0df8
|
|
| BLAKE2b-256 |
3bba42e8597b76a82fe4fb83cff8634d3899b9083959de9254b073a6a2ba0464
|
File details
Details for the file donkit_retriever-0.1.9-py3-none-any.whl.
File metadata
- Download URL: donkit_retriever-0.1.9-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.13.12 Darwin/25.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50e9685c74ca6efa6905fa078bd6da3af9ce0b303be39d70b496cabb1c158dba
|
|
| MD5 |
f209f3dd833a2f6c239d771ee653e337
|
|
| BLAKE2b-256 |
f79af917c02f3ec49c7d3821ae9b23f58425316b7fb656a8929912a688353921
|