How martin-papy/qdrant-loader works
1. Repository shape
This is a monorepo with three runtime packages and one documentation site:
- qdrant-loader: ingestion and indexing engine
- qdrant-loader-core: shared LLM/logging abstractions
- qdrant-loader-mcp-server: retrieval/search server exposed through MCP
- website: static docs/marketing site built from Markdown
2. End-to-end system flow
The main data path is: external content sources → connectors → file conversion/chunking → embeddings/metadata → Qdrant vector store → MCP search server → AI tools/clients.
The ingestion package writes data into Qdrant; the MCP server reads from Qdrant and returns formatted search/intelligence results to IDEs and other MCP-compatible clients.
3. Ingestion engine boundary
packages/qdrant-loader owns all write-side behavior. It is responsible for:
- workspace/project configuration
- source discovery and syncing
- document conversion and chunking
- embedding generation
- collection initialization and upserts into Qdrant
- incremental state tracking and monitoring
4. Source connector layer
The ingestion package has a connector abstraction with concrete integrations for:
- Git repositories
- Confluence Cloud/Data Center
- Jira Cloud/Data Center
- Public web docs
- Local files
Shared HTTP, attachment, and rate-limit utilities sit underneath these connectors. This boundary is where source-specific authentication, pagination, crawling, and file handling are isolated.
5. Document processing pipeline
The core ingestion flow is layered:
- source-specific connectors fetch raw content
- file conversion normalizes non-text inputs via MarkItDown-style conversion support
- chunking strategies split content by type
- embeddings are generated
- results are upserted into Qdrant
The chunking layer is deliberately modular, with separate strategies for markdown, code, HTML, JSON, and default/text content, plus metadata extraction and semantic analysis.
6. State, incrementality, and workspace model
qdrant-loader has explicit state management under core/state and project/workspace management under core/project_manager.py and config/*.
This is the mechanism that supports incremental ingestion, change detection, and multi-project organization. Configuration is centrally modeled around a workspace containing global settings and per-project sources.
7. Qdrant as the persistence backbone
Qdrant is the main durable store and the boundary between ingestion and retrieval.
Ingestion code initializes collections, manages collection settings, and writes vectors plus metadata.
Retrieval code in the MCP server assumes the data model already exists in Qdrant and focuses on search, ranking, and presentation.
8. LLM/provider abstraction
qdrant-loader-core contains the provider-agnostic LLM layer. It abstracts OpenAI, Azure OpenAI, Ollama, and custom endpoints behind a shared factory/settings interface.
This package also handles rate limiting, tokenization, provider-specific errors, and structured logging. It is a shared dependency for both ingestion-time enrichment and MCP-time intelligence features.
9. MCP server boundary
packages/qdrant-loader-mcp-server is the read-only integration layer for AI tools. It exposes MCP protocol support with dual transport:
- stdio for local IDE integration
- HTTP/SSE for networked use and streaming
The server owns protocol handling, request routing, session/transport concerns, and the user-facing tool schema.
10. Search architecture inside the MCP server
Search is split into multiple layers:
- query parsing and preprocessing
- retrieval engines
- result combination/ranking
- output formatting
There are separate pathways for semantic/vector search, hybrid search, faceted search, and topic/intelligence-oriented workflows. This separation lets the server combine lexical, vector, metadata, and reranking signals before returning results.
11. Cross-document intelligence features
The MCP server includes a larger “intelligence” subsystem beyond plain search:
- document similarity and clustering
- relationship analysis
- knowledge graph construction/traversal
- conflict detection and complementary content discovery
These features are organized under search/enhanced and search/hybrid, and they consume the same indexed corpus in Qdrant while adding analytical pipelines and optional LLM-assisted validation.
12. Formatting and protocol adaptation
The MCP layer includes dedicated formatters and handlers that translate search/intelligence results into protocol-friendly outputs.
This is an important boundary: internal search models are not returned directly. Instead, results are normalized into MCP schemas and formatted for different tool modes and response shapes.
13. Docs site and build automation
The website directory is a separate static-site build system that turns Markdown documentation into the published site.
GitHub Actions workflows cover documentation publishing, tests, quality gates, and release automation. These are supporting systems rather than runtime services, but they matter for how the repo is maintained and delivered.
14. Testing strategy
The repo is heavily tested with package-level unit tests and integration tests.
The ingestion package emphasizes connector, chunking, pipeline, config, and state tests. The MCP server has extensive search/transport/integration coverage, reflecting its split architecture and the number of result-processing paths that must remain stable.
15. Practical architecture summary
If you diagram this repository, draw three main boxes:
- Ingestion/write path: source systems → connectors → conversion/chunking/embedding → Qdrant
- Core shared services: LLM provider abstraction, logging, rate limiting
- MCP/read path: Qdrant → search/hybrid/intelligence engines → MCP transports → IDE/client
Everything else is supporting structure around configuration, state, docs, and delivery.
Main entry points: pipeline Ingestion pipeline · connectors Connectors · embedding Embeddings · mcp Tool handlers
Components 22
qdrant-loader
Write-side ingestion and indexing engine
- Workspace config · Global settings, per-project sources, and validation for multi-project ingestion
packages/qdrant-loader/src/qdrant_loader/config/workspace.py - Project state · Incremental change tracking, session state, and document-state queries
packages/qdrant-loader/src/qdrant_loader/core/state - Connectors · Source-specific integrations for Git, Confluence, Jira, public docs, and local files
packages/qdrant-loader/src/qdrant_loader/connectors - HTTP utilities · Common HTTP client, attachment, and rate-limit support under connectors
packages/qdrant-loader/src/qdrant_loader/connectors/shared/http - File conversion · Non-text input detection and MarkItDown-style conversion to text
packages/qdrant-loader/src/qdrant_loader/core/file_conversion - Chunking pipeline · Strategy-based splitting for markdown, code, HTML, JSON, and default text
packages/qdrant-loader/src/qdrant_loader/core/chunking/strategy - Text analysis · Semantic analysis and topic modeling used during ingestion enrichment
packages/qdrant-loader/src/qdrant_loader/core/text_processing - Embeddings · Embedding generation for indexed content
packages/qdrant-loader/src/qdrant_loader/core/embedding - Qdrant write · Collection initialization, upserts, and metadata persistence into Qdrant
packages/qdrant-loader/src/qdrant_loader/core/qdrant_manager.py - Ingestion pipeline · Async source processing, worker orchestration, and end-to-end write flow
packages/qdrant-loader/src/qdrant_loader/core/pipeline
qdrant-loader-core
Shared LLM and logging abstractions
- LLM factory · Provider-agnostic factory and settings for OpenAI, Azure OpenAI, Ollama, and custom endpoints
packages/qdrant-loader-core/src/qdrant_loader_core/llm/factory.py - Structured logging · Logging filters, processors, and redaction support shared across packages
packages/qdrant-loader-core/src/qdrant_loader_core/logging.py - Rate limiting · Tokenization, provider throttling, and rate-limit policies for LLM usage
packages/qdrant-loader-core/src/qdrant_loader_core/llm/ratelimit.py
qdrant-loader-mcp-server
Read-side MCP retrieval server
- MCP transport · stdio and HTTP/SSE transports, sessions, and protocol routing
packages/qdrant-loader-mcp-server/src/qdrant_loader_mcp_server/transport - Tool handlers · MCP request routing, search handlers, and intelligence handlers
packages/qdrant-loader-mcp-server/src/qdrant_loader_mcp_server/mcp - Search engines · Semantic, hybrid, faceted, and topic-oriented retrieval orchestration
packages/qdrant-loader-mcp-server/src/qdrant_loader_mcp_server/search/engine - Intelligence · Cross-document similarity, clustering, relationship analysis, conflict detection, and knowledge graph workflows
packages/qdrant-loader-mcp-server/src/qdrant_loader_mcp_server/search/enhanced - Result formatters · Normalization of internal search results into MCP-friendly response shapes
packages/qdrant-loader-mcp-server/src/qdrant_loader_mcp_server/mcp/formatters - Qdrant read · Persistent corpus read by the MCP server for retrieval and analysis
website
Static docs and marketing site
- Docs site · Markdown-driven docs and marketing site build system
website/build.py
delivery
Automation and release support
- GitHub Actions · Docs publishing, tests, quality gates, and release workflows
.github/workflows
Other components
- Source systems · Git, Confluence, Jira, web docs, and local files entering the ingestion path
Connections 26
- Source systems → Connectors: fetch · Source systems are discovered and synced by connectors
- Connectors → HTTP utilities: uses · Connectors rely on shared HTTP, attachment, and rate-limit utilities
- Connectors → File conversion: normalize · Raw content and attachments are converted into text-friendly form
- File conversion → Chunking pipeline: feed · Converted documents enter type-specific chunking strategies
- Chunking pipeline → Text analysis: enrich · Chunks are analyzed for semantics and topical signals
- Text analysis → Embeddings: prepare · Analyzed text is transformed into vector-ready inputs
- Embeddings → Qdrant write: upsert · Vectors and metadata are written into Qdrant collections
- Workspace config → Ingestion pipeline: configure · Workspace and project settings drive ingestion orchestration
- Project state → Ingestion pipeline: track · State changes and incremental sync decisions guide the pipeline
- Ingestion pipeline → Connectors: orchestrates · The ingestion pipeline coordinates source processing
- Ingestion pipeline → File conversion: routes · Pipeline stages pass documents into conversion when needed
- Ingestion pipeline → Chunking pipeline: routes · Pipeline stages dispatch normalized content to chunking
- Ingestion pipeline → Embeddings: routes · Pipeline stages send chunks to embedding generation
- Ingestion pipeline → Qdrant write: writes · The pipeline culminates in Qdrant initialization and upserts
- LLM factory → Embeddings: supports · Shared LLM abstraction can be used for ingestion-time enrichment
- LLM factory → Intelligence: supports · The same provider layer supports intelligence workflows in the MCP server
- Structured logging → Ingestion pipeline: observes · Ingestion uses shared structured logging and redaction
- Rate limiting → LLM factory: governs · LLM usage is controlled by shared throttling and tokenization support
- Qdrant read → Search engines: queries · Retrieval engines read the indexed corpus from Qdrant
- Search engines → Tool handlers: serve · Search engines are exposed through MCP request handlers
- Intelligence → Tool handlers: serve · Cross-document intelligence workflows are surfaced by MCP handlers
- MCP transport → Tool handlers: routes · Transport layer dispatches protocol requests to handlers
- Tool handlers → Result formatters: formats · Handlers convert internal results into protocol-friendly outputs
- Search engines → Qdrant read: retrieves · Search paths resolve against the existing Qdrant data model
- Intelligence → Qdrant read: analyzes · Intelligence workflows analyze the same indexed corpus
- Docs site → GitHub Actions: published by · The docs site is built and deployed through repository workflows