Serpent is a small C++ framework for building RAG (retrieval-augmented generation) pipelines and AI-powered applications.
- Modular Design: Swap components via clean interfaces
- Hybrid Search: hnswlib (dense) + BM25 (sparse) + RRF fusion
- Dual LLM Support: Local models (llama.cpp) + Cloud APIs (OpenRouter)
- Document Loaders: PDF, DOCX, and plain text
graph TB
subgraph Loaders["Document Loaders"]
TXT["TextLoader"]
PDF["PdfLoader"]
DOCX["DocxLoader"]
end
subgraph Chunking["Text Chunking"]
RC["RecursiveChunker"]
end
subgraph Core["Core"]
DS["MemoryDocumentStore"]
SQL["SqliteStore"]
end
subgraph Retrieval["Retrieval"]
HNSW["HNSWStore<br/>(Dense Vectors)"]
BM25["BM25Index<br/>(Sparse)"]
HR["HybridRetriever"]
RRF["RRF Fusion"]
end
subgraph Providers["LLM Providers"]
LLAMA["LlamaCppProvider<br/>(Local)"]
OR["OpenRouterProvider<br/>(Cloud)"]
end
subgraph Utils["Utilities"]
MM["ModelManager"]
end
TXT & PDF & DOCX --> RC
RC --> DS
DS --> SQL
DS --> HNSW & BM25
HNSW & BM25 --> HR
HR --> RRF
RRF --> LLAMA & OR
MM --> LLAMA
To be added.
To be added.
See CONTRIBUTING.md for details on how to make a contribution.
Serpent is available under either of the following licenses:
- MIT License (LICENSE-MIT)
- Apache License, Version 2.0 (LICENSE-APACHE)
- The logo is from here with some modifications.