Skip to content

Search and filters ​

ts
import { vectorFilter } from '@anvia/core/vector-store'

const results = await store.index(embeddings).search({
  query: 'reset a password',
  topK: 5,
  filter: vectorFilter.and(
    vectorFilter.eq('tenantId', 'acme'),
    vectorFilter.gt('revision', 3),
  ),
})

filterToPineconeFilter maps eq, gt, lt, and, and or to Pinecone's $eq, $gt, $lt, $and, and $or structure.

Search is always executed inside the namespace chosen at connection time. Results from several physical embeddings are collapsed to the highest-scoring logical document.

Filterable metadata must conform to Pinecone's accepted value types. Treat namespaces and filters as retrieval controls, not proof that the current user may access a document.

Built for Anvia.