Metadata-Version: 2.4
Name: langchain-graph-retriever
Version: 0.4.4
Summary: LangChain retriever for traversing document graphs on top of vector-based similarity search.
Project-URL: Homepage, https://datastax.github.io/graph-rag
Project-URL: GitHub, https://github.com/datastax/graph-rag
Project-URL: Bug Reports, https://github.com/datastax/graph-rag/issues
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: RAG,graph RAG,langchain
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: backoff>=2.2.1
Requires-Dist: graph-retriever
Requires-Dist: immutabledict>=4.2.1
Requires-Dist: langchain-core>=0.3.29
Requires-Dist: networkx>=3.4.2
Requires-Dist: pydantic>=2.10.4
Requires-Dist: typing-extensions>=4.12.2
Provides-Extra: astra
Requires-Dist: astrapy>=1.5.2; extra == 'astra'
Requires-Dist: httpx>=0.28.1; extra == 'astra'
Requires-Dist: langchain-astradb>=0.5.3; extra == 'astra'
Provides-Extra: cassandra
Requires-Dist: cassio>=0.1.10; extra == 'cassandra'
Requires-Dist: langchain-community>=0.3.14; extra == 'cassandra'
Provides-Extra: chroma
Requires-Dist: chromadb>=0.5.23; extra == 'chroma'
Requires-Dist: langchain-chroma>=0.2.0; extra == 'chroma'
Provides-Extra: gliner
Requires-Dist: gliner==0.2.13; extra == 'gliner'
Provides-Extra: html
Requires-Dist: beautifulsoup4>=4.12.3; extra == 'html'
Provides-Extra: keybert
Requires-Dist: keybert>=0.8.5; extra == 'keybert'
Provides-Extra: opensearch
Requires-Dist: langchain-community>=0.3.14; extra == 'opensearch'
Requires-Dist: opensearch-py>=2.8.0; extra == 'opensearch'
Provides-Extra: spacy
Requires-Dist: spacy>=3.8.4; extra == 'spacy'
Description-Content-Type: text/markdown

# LangChain Graph Retriever

LangChain Graph Retriever is a Python library that supports traversing a document graph on top of vector-based similarity search.
It works seamlessly with LangChain's retriever framework and supports various graph traversal strategies for efficient document discovery.

## Features

- **Vector Search**: Perform similarity searches using vector embeddings.
- **Graph Traversal**: Apply traversal strategies such as breadth-first (Eager) or Maximal Marginal Relevance (MMR) to explore document relationships.
- **Customizable Strategies**: Easily extend and configure traversal strategies to meet your specific use case.
- **Multiple Adapters**: Support for various vector stores, including AstraDB, Cassandra, Chroma, OpenSearch, and in-memory storage.
- **Synchronous and Asynchronous Retrieval**: Supports both sync and async workflows for flexibility in different applications.

## Installation

Install the library via pip:

```bash
pip install langchain-graph-retriever
```

## Getting Started

Here is an example of how to use LangChain Graph Retriever:

```python
from langchain_graph_retriever import GraphRetriever
from langchain_core.vectorstores import Chroma

# Initialize the vector store (Chroma in this example)
vector_store = Chroma(embedding_function=your_embedding_function)

# Create the Graph Retriever
retriever = GraphRetriever(
    store=vector_store,
    # Define edges based on document metadata
    edges=[("keywords", "keywords")],
)

# Perform a retrieval
documents = retriever.retrieve("What is the capital of France?")

# Print the results
for doc in documents:
    print(doc.page_content)
```

## License

This project is licensed under the Apache 2 License. See the LICENSE file for more details.
