Skip to main content

LangChain

LangChain is a development framework that makes it easy to construct LLM-powered applications using a variety of different providers for different services. ApertureDB's capabilities fit within the LangChain ecosystem in two main areas: vector store and graph database.

ApertureDB is both a vector store and a graph database. Currently, LangChain supports the vector store functionality of ApertureDB. This means that you can use ApertureDB as a provider for LangChain's vector store. This allows you to store and retrieve vectors from ApertureDB using LangChain's API.

In the future, we plan to add support for ApertureDB's graph database functionality to LangChain. This will allow you to store and query graphs in ApertureDB using LangChain's API.

Vector Store

ApertureDB's integration with LangChain is done through the ApertureDB Vector Store. This is a Python package that provides an interface for storing and retrieving vectors from ApertureDB.

For a tutorial on using ApertureDB in LangChain, see the Jupyter Notebook. You can also find the source code for the ApertureDB Vector Store on GitHub.

Like most LangChain vector stores, the ApertureDB vector store can be used as a retriever. This is useful for using an ApertureDB vector store as part of pipelines such as RAG.

Graph database

It is possible to use a lot of ApertureDB's functionality through LangChain, but the full power of ApertureDB is only available through the ApertureDB API. For example, you can use LangChain to store and retrieve vectors from ApertureDB, and then use the ApertureDB API to query the graph database.

In the future, we plan to add support for ApertureDB's graph database functionality to LangChain. This will allow you to store and query graphs in ApertureDB using LangChain's API. This will make it easier to use ApertureDB as a graph database in LangChain applications.

Implementation details

Those attempting a hybrid approach should note a few of details of how LangChain vectore stores and documents are represented internally in ApertureDB:

  • The LangChain vector store corresponds to a DescriptorSet in ApertureDB
  • Documents with embeddings correspond to Descriptors.
  • The document id field is stored in the uniqueid property
  • The document text field is stored in the text property
  • Metadata properties are stored as properties with a lc_ prefix.