See Ash Code logo See Ash Code

I wrote adapters for several vector stores. What belongs in their shared interface?

Ashlynn Antrobus
• • 3 min read

I added vector-store adapters to a feature branch of rag-mcp, my tool for ingesting and searching documents. The shared method names are easy to line up. The behavior behind them needs a closer look.

A dragon considers three matching doorways containing gears, papers, and drawers.

The May 11 branch commit adds adapters for PostgreSQL, Chroma, Qdrant, Milvus, Pinecone, and MongoDB. This is branch work, not a claim that the adapters are merged or that every backend has passed a live compatibility test.

The interface follows ingestion’s needs

VectorStoreAdapter is a protocol with methods for adding texts, searching, listing filenames, deleting a filename’s documents, and checking whether metadata exists.

That last group comes from the ingestion problem. My application needs to manage source documents as well as retrieve similar chunks.

What does listing promise?

The Pinecone implementation queries with a zero vector of length 1536 and asks for up to 10000 matches, then collects filenames from that result.

That can’t establish a complete inventory for an arbitrarily larger store. It also assumes a vector dimension instead of deriving it from the selected embedding setup. Calling the method list_filenames hides those constraints unless I define what completeness it promises.

Qdrant’s implementation takes a different approach: it continues scrolling while another page offset exists. That is an attempt to enumerate records rather than sample search results. It still depends on the client call and expected payload structure being correct.

The boolean results need a definition too

Chroma’s delete method returns false when its lookup finds no matching IDs. Several other adapters return true after issuing a delete without checking whether anything was removed.

Those aren’t the same answer to “did this filename exist?” If the interface means “the delete request completed,” the caller needs that definition. If it means “at least one document was removed,” those implementations need more information.

Milvus’s expression strings also need a quoting review for metadata containing quote characters. A shared Python signature doesn’t make backend query syntax disappear.

The adapters mostly forward text insertion and similarity search to the underlying library. Listing and existence checks use more backend-specific code:

AdapterListing or existence implementation in this branch
PostgreSQLQueries stored metadata within the selected collection.
ChromaReads metadata with get; checks a filtered result for an ID.
QdrantScrolls payloads in pages for listing; uses a filtered scroll for existence.
MilvusBuilds query expressions against filename or supplied metadata.
MongoDBUses collection operations on an assumed nested metadata field.
PineconeLists a bounded search sample; checks existence with filtered similarity search.

These describe the code, not verified capabilities of every SDK version. Each adapter still needs checks against its actual client and data layout.

Before I can use the adapters interchangeably, I need to know whether they return complete listings, how they report deletes and whether an existence check has to embed a query.

AA

Written by Ashlynn Antrobus

Software developer, author, and builder. Sharing technical lessons learned from building tools like Ebook2Text, IndexedDict, and rag-mcp, and navigating life as a programmer with dyslexia.