Vector stores
By default RAGLite keeps vectors in memory and saves them as JSON files under storeDir. It needs nothing else to run. For large indexes, or to share an index between machines, set vectorStore.
| Store | provider |
TypeScript | Python | Extra install |
|---|---|---|---|---|
| Memory (default) | memory |
✓ | ✓ | none |
| Qdrant | qdrant |
✓ | ✓ | none |
| Pinecone | pinecone |
✓ | ✓ | none |
| LanceDB | lancedb |
✓ | — | npm install @lancedb/lancedb |
Memory (default)
Section titled “Memory (default)”new Document("./policy.pdf", { vectorStore: { provider: "memory", storeDir: ".raglite" } });Document("./policy.pdf", {"vectorStore": {"provider": "memory", "storeDir": ".raglite"}})Qdrant
Section titled “Qdrant”Works with a local Qdrant (for example in Docker) or Qdrant Cloud. Each document gets its own collection, raglite_<namespace>. Set indexName to keep many documents in one shared collection: each point is tagged with its document’s namespace, so rebuilding one document never affects the others.
new Document("./policy.pdf", { vectorStore: { provider: "qdrant", url: "http://localhost:6333", // or your Qdrant Cloud URL apiKey: process.env.QDRANT_API_KEY, // optional indexName: "company_docs", // optional },});Document("./policy.pdf", { "vectorStore": { "provider": "qdrant", "url": "http://localhost:6333", # or your Qdrant Cloud URL "apiKey": os.environ.get("QDRANT_API_KEY"), # optional "indexName": "company_docs", # optional },})Pinecone
Section titled “Pinecone”Each document is stored in its own Pinecone namespace inside the index. url is the index host.
new Document("./policy.pdf", { vectorStore: { provider: "pinecone", url: "https://your-index-host.svc.pinecone.io", apiKey: process.env.PINECONE_API_KEY, },});Document("./policy.pdf", { "vectorStore": { "provider": "pinecone", "url": "https://your-index-host.svc.pinecone.io", "apiKey": os.environ["PINECONE_API_KEY"], },})LanceDB (TypeScript only)
Section titled “LanceDB (TypeScript only)”An embedded database on the local filesystem, in <storeDir>/lancedb.
new Document("./policy.pdf", { vectorStore: { provider: "lancedb", storeDir: ".raglite" } });The keyword index with remote stores
Section titled “The keyword index with remote stores”Hybrid search keeps its keyword index under storeDir, even with Qdrant or Pinecone. Keep storeDir on persistent disk, or the keyword index is lost on restart and keyword search falls back to vector search until you rebuild.
Collections
Section titled “Collections”With a DocumentCollection, pass a provider config as above, never a store instance. See Collections.
Your own store
Section titled “Your own store”Implement the VectorStore interface and pass an instance as vectorStore.
import { Document, type VectorStore } from "raglite-toolkit";
class MyStore implements VectorStore { // Required: namespace, load, reset, add, search, count, saveIndexMetadata, readIndexMetadata // Optional: listChunks() lets hybrid search rebuild a missing keyword index from your store; // keywordSearch(query, topK) replaces the built-in BM25 index with your own.}
new Document("./policy.pdf", { vectorStore: new MyStore() });from raglite import Document, VectorStore
class MyStore(VectorStore): # Required: namespace (property), load, reset, add, search, count, # save_index_metadata, read_index_metadata # Optional: list_chunks() lets hybrid search rebuild a missing keyword index # from your store; keyword_search(query, top_k) replaces the # built-in BM25 index with your own. ...
Document("./policy.pdf", {"vectorStore": MyStore()})search receives a third argument, filter, holding the metadata filter conditions on per-chunk fields (chunk, totalChunks, page, pageEnd, section). Apply it before the topK cut; matchesFilter(metadata, filter) (matches_filter in Python) checks one chunk. A store that ignores it still returns correct results, because RAGLite filters the results again, but a filtered search may then return fewer than topK. keywordSearch takes the same argument.
To extend a built-in store, import MemoryVectorStore, QdrantVectorStore, PineconeVectorStore or LanceDbVectorStore from raglite-toolkit, or the first three from raglite.vectordb in Python.