Skip to main content

Add your description here

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-0.1.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-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langchain_gel-0.1.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-0.1.0.tar.gz
Algorithm Hash digest
SHA256 76cb4e45532a7be5d2a557f3d079b3c2743ced3a76b0461e7be32a6783c87c04
MD5 143486eba1e7ac95cc729cd9a9394cf9
BLAKE2b-256 6dc5b576a81a6c992437f187eb3a9cca4b849bcc05f68e782ab46a5c527f5b97

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_gel-0.1.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-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: langchain_gel-0.1.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-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe1d315194d42f6e28f1fda676bdaefa1d3eef66de2b6e91d7a36a283446d0a5
MD5 f6f288890fd1b28e68f780f4390ae1ba
BLAKE2b-256 b9278e3bca5839c2cba564ebc8207e00ee6a7c8d010a816ec794c589e18c5177

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_gel-0.1.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