Skip to main content
This notebook covers how to get started with the openGauss VectorStore. openGauss is a high-performance relational database with native vector storage and retrieval capabilities. This integration enables ACID-compliant vector operations within LangChain applications, combining traditional SQL functionality with modern AI-driven similarity search. vector store.

Setup

Launch openGauss Container

Install langchain-opengauss

System Requirements:
  • openGauss ≥ 7.0.0
  • Python ≥ 3.8
  • psycopg2-binary

Credentials

Using your openGauss Credentials

Initialization

Manage vector store

Add items to vector store

Update items in vector store

Delete items from vector store

Query vector store

Once your vector store has been created and the relevant documents have been added you will most likely wish to query it during the running of your chain or agent.

Query directly

Performing a simple similarity search can be done as follows:
  • TODO: Edit and then run code cell to generate output
If you want to execute a similarity search and receive the corresponding scores you can run:

Query by turning into retriever

You can also transform the vector store into a retriever for easier usage in your chains.
  • TODO: Edit and then run code cell to generate output

Usage for retrieval-augmented generation

For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:

Configuration

Connection settings

Supported combinations

Performance optimization

Index tuning guidelines

HNSW Parameters:
  • m: 16-100 (balance between recall and memory)
  • ef_construction: 64-1000 (must be > 2*m)
IVFFLAT Recommendations:

Connection pooling

Limitations

  • bit and sparsevec vector types currently in development
  • Maximum vector dimensions: 2000 for vector type