Metadata-Version: 2.4
Name: langchain-akasicdb
Version: 1.0.0
Summary: langchain-akasicdb package is an implementation of core LangChain abstraction for AkasicDB
License-File: LICENSE
Author: GraphAI, Co., Ltd.
Requires-Python: >=3.11,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: akasicdb[sdk] (>=1.0.0)
Requires-Dist: langchain-core (>=1.4.0,<2.0.0)
Requires-Dist: numpy (>=2.1.0,<3.0.0)
Requires-Dist: psycopg (>=3.1.19,<4.0.0)
Description-Content-Type: text/markdown

# langchain-akasicdb

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

## Requirements

**Environment Prerequisites (For Local Testing/Examples):**

* **PostgreSQL:** A running PostgreSQL with the [`akasicdb`](https://github.com/graphai-repository/akasicdb-py) extension enabled.
* **OpenAI API Key:** Required for running RAG examples.

## Installation

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

## Quick Start

```python
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`:

```python
# Still works, but deprecated:
from langchain_vectoron import VectorOnVectorStore

# Migrate to:
from langchain_akasicdb import AkasicDBVector
```

## Examples

Please see the [Jupyter Notebook example](./examples/langchain-rag-openai-vectoron.ipynb).

> [!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.
    ```sql
    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.
    ```bash
    export POSTGRES_HOST=localhost
    export POSTGRES_USER=postgres
    export POSTGRES_PASSWORD=akasicdb
    export POSTGRES_PORT=5432
    ```

**Install dependencies for tests:**

```shell
poetry install --with test
```

**Run unit tests:**

```shell
# 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:**

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

**To generate an HTML report:**

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

