Metadata-Version: 2.4
Name: langgraph-kusto
Version: 0.0.1
Summary: LangGraph vector store implementation for Azure Data Explorer (Kusto) - PRE-ALPHA VERSION
Author-email: Daniel Dror <danield137@gmail.com>
Maintainer-email: Daniel Dror <danield137@gmail.com>
Project-URL: Homepage, https://github.com/danield137/langgraph-kusto
Project-URL: Bug Reports, https://github.com/danield137/langgraph-kusto/issues
Project-URL: Source, https://github.com/danield137/langgraph-kusto
Keywords: langgraph,kusto,azure,eventhouse,fabric,data-explorer,vector-store,llm
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: langgraph==1.0.3
Requires-Dist: azure-kusto-data>=4.2.0
Requires-Dist: azure-identity>=1.12.0
Requires-Dist: termcolor==3.2.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black>=22.0; extra == "dev"
Requires-Dist: isort>=5.0; extra == "dev"

# langgraph-kusto

This repository provides Kusto-backed storage and checkpointing for LangGraph, including optional semantic search using Kusto's `ai_embeddings` plugin.

## Kusto store search example

The `KustoStore` supports two search modes:

- **Vector search** when an embedding function is configured
- **Text search fallback** when no embedding function is provided

Below is an example of configuring a `KustoStore` with the `KustoOpenAIEmbeddingFn` and running a search.

```python
from langgraph_kusto.common.kusto_client import KustoClient
from langgraph_kusto.store.store import KustoStore, KustoStoreConfig
from langgraph_kusto.store.embeddings import KustoOpenAIEmbeddingFn

# Create Kusto client from environment
client = KustoClient.from_env()

# Configure embedding function backed by Kusto's ai_embeddings plugin
embedding_fn = KustoOpenAIEmbeddingFn(
    client=client,
    model_uri="https://myaccount.openai.azure.com/openai/deployments/text-embedding-3-small/embeddings?api-version=2024-06-01;impersonate",  # or your configured embedding model
)

# Configure the store
store_config = KustoStoreConfig(
    client=client,
    embedding_function=embedding_fn,
)

store = KustoStore(config=store_config)

# Run a semantic search in a given namespace
results = store.search(namespace="my-namespace", query="find relevant items", k=5)

for item in results:
    print(item["key"], item["score"], item["chunk_string"])
```

If you omit the `embedding_function` when creating `KustoStoreConfig`, `store.search` will automatically fall back to a simple text search over the stored values for the requested `namespace`.
