Skip to main content

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:

  • QdrantVectorstoreModule
  • ChromaVectorstoreModule
  • MilvusVectorstoreModule

VectorstoreService

Orchestrates search operations:

  1. Filename search (if enabled)
  2. Vector search
  3. Neighbor fetching (if partial_search enabled)
  4. Document combination and deduplication

Development

# Install dependencies
poetry install

# Run tests
poetry run pytest

# Run linter
poetry run ruff check .

License

Proprietary

Metadata

Release files for donkit-retriever 0.1.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for donkit-retriever 0.1.13
File Size Uploaded
donkit_retriever-0.1.13.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for donkit-retriever 0.1.13
File Interpreter ABI Platform
donkit_retriever-0.1.13-py3-none-any.whl Python 3 none any Details

Total release size: 32.7 kB

Release files / donkit_retriever-0.1.13.tar.gz

Download URL donkit_retriever-0.1.13.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
268cedff318c9df5dcbb2c1adf281dfa17123465258067879593e50807cb0c4d
BLAKE2b-256 checksum
How to use checksums
e7151b1429f26ec152cc86877b2b1f9330c6f8732931b071897ebf3dd5c73c20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.2 CPython/3.13.1 Darwin/25.3.0

Release files / donkit_retriever-0.1.13-py3-none-any.whl

Download URL donkit_retriever-0.1.13-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
922babcab2b29092293f31df4d321015f672d1cf5495fe90ca29c70effcc7389
BLAKE2b-256 checksum
How to use checksums
790dc8b4b22ce35b7a3f2411f74e103603d4a7bf9bba66ec58fb465855df1659
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.2 CPython/3.13.1 Darwin/25.3.0

Release history Release notifications | RSS feed

This release

0.1.13 This release

2 release files

0.1.12

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page