Available for: Python and TypeScript.
recordRetrieval/record_retrieval helper. Zespan now patches the v4 collections client (Python) / weaviate-client v3 (Node) so every near_vector query and data.insert() call is captured automatically, the same way LLM provider calls already are.
Patched automatically as part of
zespan.autopatch(), which both SDKs run on init() unless you pass autopatch: false (autopatch=False in Python). There’s no separate opt-in call for vector-DB tracing.What gets traced
- Reads —
collection.query.near_vector()(Python) /collection.query.nearVector()(Node) emits aretrieverspan. This is the v4-style, method-based collections API (gRPC transport) — the older GraphQL builder chain (.withNearVector().withLimit().do()) is not patched - Writes —
collection.data.insert()(single object, REST transport) emits anembeddingspan. Batch insert methods are not patched
- Python
- TypeScript
Installation
Usage
Only the sync Weaviate client is auto-traced.
WeaviateAsyncClient (the async client) is not yet covered — if you’re on the async client, use the manual record_retrieval/record_vector_search helpers instead.What gets captured
Read span (near_vector) — span_kind: "retriever", operation: "vector_search"
content follows your storePrompts/store_prompts setting and the same redaction rules as prompt text — set storePrompts: false and object text is dropped while document_id/source/score are still kept.
Write span (data.insert()) — span_kind: "embedding", operation: "vector_upsert"
Next steps
- Manual spans — the
record_vector_search()/recordVectorSearch()helper for pgvector, and the fullwith_zespan_context()/withZespanContext()trace-linking pattern - Evaluating RAG pipelines — score retrieval quality once
rag_contextsis on the trace - Pinecone, Chroma, Qdrant — the other auto-traced vector DBs

