Class QdrantVectorIndex

java.lang.Object
com.tnsai.intelligence.rag.vector.QdrantVectorIndex
All Implemented Interfaces:
com.tnsai.memory.advanced.VectorIndex

public final class QdrantVectorIndex extends Object implements com.tnsai.memory.advanced.VectorIndex
Qdrant-backed VectorIndex.

Opens only when tnsai.vector.qdrant.url (or TNSAI_VECTOR_QDRANT_URL) is set. The official Qdrant client is never a required dependency: REST is spoken through QdrantTransport.

Bindings pass separate namespace and ownership scopes. Corpora with the same configuration may share a physical collection, while each live provider-created engine receives a lifecycle-unique point owner. Role-bound owners remain deterministic so a restarted process still sees the previous corpus. clear() removes only the scoped owner's active corpus, scrubs its payload and vectors, and retains non-searchable fence records for a bounded replay horizon so delayed remote writes cannot resurrect deleted content. A later lease sweep physically reclaims those records. It never drops the collection.

Since:
0.14.0
  • Field Details

  • Constructor Details

  • Method Details

    • isConfigured

      public static boolean isConfigured()
      Opens a live HTTP index when a URL is configured.
      Returns:
      empty when Qdrant is not configured
    • configured

      public static Optional<QdrantVectorIndex> configured()
    • configured

      public static Optional<QdrantVectorIndex> configured(String scope)
      Opens a live HTTP index namespaced to scope.

      Literal public scopes retain deterministic namespace and owner derivation. Internal lifecycle-managed scopes may share a compatible physical collection while using distinct full-digest owners.

      Parameters:
      scope - binding identity and source set, or null for the shared standalone collection
      Returns:
      empty when Qdrant is not configured
    • scopedCollection

      public static String scopedCollection(String base, String scope)
      Collection name for a binding scope.
      Parameters:
      base - configured collection prefix
      scope - binding identity, or blank for base itself
      Returns:
      Qdrant collection name
    • upsert

      public void upsert(String id, com.tnsai.memory.strategy.MemoryEntry entry, float[] vector)
      Specified by:
      upsert in interface com.tnsai.memory.advanced.VectorIndex
    • remove

      public boolean remove(String id)
      Specified by:
      remove in interface com.tnsai.memory.advanced.VectorIndex
    • clear

      public void clear()
      Specified by:
      clear in interface com.tnsai.memory.advanced.VectorIndex
    • size

      public int size()
      Specified by:
      size in interface com.tnsai.memory.advanced.VectorIndex
    • searchByVector

      public List<com.tnsai.memory.advanced.ScoredEntry> searchByVector(float[] queryVector, int topK)
      Specified by:
      searchByVector in interface com.tnsai.memory.advanced.VectorIndex