Skip to main content

LangChain

Use the ApertureDB vector store to add documents and retrieve text by embedding similarity. Install the SDK integration with pip install 'aperturedb[langchain]>=1.0.1,<2'. Supply an authenticated connector and the same embedding model for ingestion and retrieval.

from aperturedb.LangChain import ApertureDB

store = ApertureDB(embeddings=embeddings, descriptor_class="Documents",
dimensions=384, engine="HNSW", metric="CS", client=client)
store.add_documents(documents)
retriever = store.as_retriever(search_kwargs={"k": 4})
matches = retriever.invoke("Which documents describe vector search?")

Each document is a descriptor in the named class. The store saves the document ID in uniqueid, its contents in text, and metadata in properties with the lc_ prefix. Query those descriptors and their graph connections using the ApertureDB API. Vector store API reference