Skip to main content
Gel 是一个构建在 PostgreSQL 之上的强大数据平台。
  • 用对象和图来思考,而不是表和 JOIN。
  • 使用高级 Python SDK、集成 GUI、迁移引擎、Auth 和 AI 层以及更多功能。
  • 在本地、远程或完全托管的云端运行。

安装

pip install langchain-gel

设置

  1. 运行 gel project init
  2. 编辑模式。使用 LangChain 向量存储需要以下类型:
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)
    }
}
注意:这是最小化设置。你可以随意添加任意多的类型、属性和链接! 通过阅读文档了解如何充分利用 Gel 的模式。
  1. 运行迁移:gel migration create && gel migrate

使用

from langchain_gel import GelVectorStore

vector_store = GelVectorStore(
    embeddings=embeddings,
)
查看完整使用示例 此处