Skip to main content

langchain-akasicdb package is an implementation of core LangChain abstraction for AkasicDB

Project description

langchain-akasicdb

langchain-akasicdb 는 LangChain 프레임워크에서 AkasicDB를 사용할 수 있게 해 주는 integration입니다.

Requirements

Environment Prerequisites (For Local Testing/Examples):

  • PostgreSQL: A running PostgreSQL with the akasicdb extension enabled.
  • OpenAI API Key: Required for running RAG examples.

Installation

pip install --extra-index-url https://test.pypi.org/simple/ "langchain-akasicdb"==0.6.0

Quick Start

from langchain_akasicdb import AkasicDBVector

vectorstore = AkasicDBVector(
    embedding=my_embedding,
    dimension=1536,
    db_url="postgresql+psycopg://user:pass@localhost:5432/mydb",
    collection_name="my_collection",
    new_table=True,
)

Backward Compatibility

The previous langchain_vectoron package is still available as a deprecation shim. Existing code using VectorOnVectorStore will continue to work but will emit a DeprecationWarning:

# Still works, but deprecated:
from langchain_vectoron import VectorOnVectorStore

# Migrate to:
from langchain_akasicdb import AkasicDBVector

Examples

Please see the Jupyter Notebook example.

[!NOTE] You need your own OpenAI API key to run the example.

Run tests

Prerequisite: Set up PostgreSQL Environment:

  1. Ensure Extension is Active: Connect to your running PostgreSQL instance and execute the extension creation command.
    psql -h localhost -p 5432 -U postgres -d akasicdb
    
    -- Execute inside psql:
    CREATE EXTENSION IF NOT EXISTS akasicdb;
    \q
    
  2. Set DB Environment Variables: Export connection parameters so tests and examples can connect to the database.
    export POSTGRES_HOST=localhost
    export POSTGRES_USER=postgres
    export POSTGRES_PASSWORD=akasicdb
    export POSTGRES_PORT=5432
    

Install dependencies for tests:

poetry install --with test

Run unit tests:

# run unit tests without network access
poetry run pytest --disable-socket --allow-unix-socket --asyncio-mode=auto tests/unit_tests

Run tests with coverage report:

poetry run pytest --cov=langchain_akasicdb --cov-report=term-missing

To generate an HTML report:

poetry run pytest --cov=langchain_akasicdb --cov-report=html

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_akasicdb-1.0.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

langchain_akasicdb-1.0.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langchain_akasicdb-1.0.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for langchain_akasicdb-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a66ab12d91ebe87b831e67f616cee86b6dace957155cf852e236536f502d37ae
MD5 01d2b4cec346ef4efd9c57378e1f7969
BLAKE2b-256 d0a800318fa89d9ad167e9b9ceb34e9ac2a627e39b9b8486089d1cd341c5b364

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for langchain_akasicdb-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a4b4bc566ef5fe845c74d59da98d90db866c5d602ecb436ebc963ade84f285a
MD5 8bd511cfa162e7d09c2aa08e26bbfc33
BLAKE2b-256 880c9da24a465357b21d719d3b92a9cb3fed45a2cb4eeb12981b6e93cdeeb9f5

See more details on using hashes here.

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