Gel
Gel is a powerful data platform built on top of PostgreSQL.
- Think in objects and graphs instead of tables and JOINs.
- Use the advanced Python SDK, integrated GUI, migrations engine, Auth and AI layers, and much more.
- Run locally, remotely, or in a fully managed cloud.
Installation
pip install langchain-gel
Setup
- Run
gel project init
- Edit the schema. You need the following types to use the LangChain vectorstore:
using extension pgvector;
module default {
scalar type EmbeddingVector extending ext::pgvector::vector<1536>;
type Record {
required collection: str;
text: str;
embedding: EmbeddingVector;
external_id: str {
constraint exclusive;
};
metadata: json;
index ext::pgvector::hnsw_cosine(m := 16, ef_construction := 128)
on (.embedding)
}
}
Note: this is the minimal setup. Feel free to add as many types, properties and links as you want! Learn more about taking advantage of Gel's schema by reading the docs.
- Run the migration:
gel migration create && gel migrate
.
Usage
from langchain_gel import GelVectorStore
vector_store = GelVectorStore(
embeddings=embeddings,
)
See the full usage example here.