TxtaiVectorStore#

pydantic model llama_index.vector_stores.TxtaiVectorStore#

txtai Vector Store.

Embeddings are stored within a txtai index.

During query time, the index uses txtai to query for the top k embeddings, and returns the corresponding indices.

Parameters

txtai_index (txtai.ann.ANN) – txtai index instance

Show JSON schema
{
   "title": "TxtaiVectorStore",
   "description": "txtai Vector Store.\n\nEmbeddings are stored within a txtai index.\n\nDuring query time, the index uses txtai to query for the top\nk embeddings, and returns the corresponding indices.\n\nArgs:\n    txtai_index (txtai.ann.ANN): txtai index instance",
   "type": "object",
   "properties": {
      "stores_text": {
         "title": "Stores Text",
         "default": false,
         "type": "boolean"
      },
      "is_embedding_query": {
         "title": "Is Embedding Query",
         "default": true,
         "type": "boolean"
      },
      "class_name": {
         "title": "Class Name",
         "type": "string",
         "default": "base_component"
      }
   }
}

Config
  • schema_extra: function = <function BaseComponent.Config.schema_extra at 0x7ff1e41e53a0>

Fields
  • stores_text (bool)

field stores_text: bool = False#
add(nodes: List[BaseNode], **add_kwargs: Any) List[str]#

Add nodes to index.

Parameters

nodes – List[BaseNode]: list of nodes with embeddings

delete(ref_doc_id: str, **delete_kwargs: Any) None#

Delete nodes using with ref_doc_id.

Parameters

ref_doc_id (str) – The doc_id of the document to delete.

classmethod from_persist_dir(persist_dir: str = './storage', fs: Optional[AbstractFileSystem] = None) TxtaiVectorStore#
classmethod from_persist_path(persist_path: str, fs: Optional[AbstractFileSystem] = None) TxtaiVectorStore#
persist(persist_path: str = './storage/default__vector_store.json', fs: Optional[AbstractFileSystem] = None) None#

Save to file.

This method saves the vector store to disk.

Parameters

persist_path (str) – The save_path of the file.

query(query: VectorStoreQuery, **kwargs: Any) VectorStoreQueryResult#

Query index for top k most similar nodes.

Parameters

query (VectorStoreQuery) – query to search for in the index

property client: Any#

Return the txtai index.