@galdor/memory-qdrant
v0.3.1
Published
Qdrant long-term memory store for galdor-bun: vector search over the Qdrant HTTP REST API.
Readme
@galdor/memory-qdrant
A Qdrant-backed long-term memory store for galdor,
implementing the core memory.Store interface over the Qdrant HTTP REST API. It
drops in behind a Retriever like the bundled InMemoryStore, but persists
vectors in a Qdrant collection and runs the nearest-neighbour search server-side.
This backend is vector-only (retrieve requires query.embedding).
Usage
import { openQdrant } from "@galdor/memory-qdrant";
const store = await openQdrant({
url: "http://localhost:6333", // Qdrant HTTP API
collection: "galdor_chunks", // optional; created if missing
dim: 1024, // embedding dimensionality
apiKey: process.env.QDRANT_API_KEY, // optional (Qdrant Cloud / auth)
});
await store.add([{ id: "c1", documentId: "d1", index: 0, text: "…", embedding: vec, metadata: { lang: "es" } }]);
const hits = await store.retrieve({ embedding: queryVec, k: 5, filter: { lang: "es" } });
await store.delete("d1");
await store.close();Behavior
- open creates the collection (Cosine distance, the given
dim) if missing. - add upserts by chunk
id(a deterministic UUID-shaped point id), storingdocumentId/index/text+ metadata in the payload. Rejects empty ids, dimension mismatches, and reserved__-prefixed metadata keys. - retrieve returns top-K by Cosine score (higher = better; negatives dropped);
filtermaps to a Qdrantmustexact-match clause. - delete removes every point whose
__document_idmatches.
