Skip to main content

Gel integration package for the LangChain framework

Project description

langchain-gel

This package enables LangChain to interact with Gel as a vectorstore. See LangChain's documentation to learn more about how to take advantage of that.

Note: check out Gel's AI extension to learn how to automate embedding management away while taking advantage of poweful schema and EdgeQL query language.

Usage

  1. Install Gel's Python binding and this package
pip install gel langchain-gel
  1. Initialize the project

Locally:

gel project init

In the cloud:

gel project init --server-instance <org-name>/<instance-name>
  1. Add necessary components to the schema. Gel uses explicit schema and migrations, which gives you more control and preserves data integrity. langchain-gel expects the following schema:
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)
    } 
}

Copy-paste this to dbschema/default.gel and run a migration:

gel migration create \
&& gel migrate
  1. Use GelVectorStore as usual. It's a drop-in replacement for any other vectorstore in the LangChain ecosystem.
from langchain_gel import GelVectorStore

vectorstore = GelVectorStore()

Next steps

When you are ready to migrate to Gel's native vector handling, check out Gel's documentation to find instructions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_gel-1.0.0.tar.gz (80.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_gel-1.0.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file langchain_gel-1.0.0.tar.gz.

File metadata

  • Download URL: langchain_gel-1.0.0.tar.gz
  • Upload date:
  • Size: 80.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for langchain_gel-1.0.0.tar.gz
Algorithm Hash digest
SHA256 53cf4eebaba4496e2a5aa0b7eefc7f189bac1fd7fb877959270e42cae7410ddb
MD5 48d9d3169447b11edf0a5262d68e55fe
BLAKE2b-256 4e9c5799cab72e2048190a6f4401bef796f06d61c5b5bc35a18aa64cf8ecdb73

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_gel-1.0.0.tar.gz:

Publisher: publish.yml on geldata/langchain-gel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_gel-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: langchain_gel-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for langchain_gel-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7846231db1a73a70903afbd25c0bc358f0d8a35491f4406ca2763432ff442d90
MD5 0552829cfa0bd6ff9c81073da11f72a1
BLAKE2b-256 12f16b48d1442914c373762eee0001af321b67545e360e603f6be6bdad91d331

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_gel-1.0.0-py3-none-any.whl:

Publisher: publish.yml on geldata/langchain-gel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page