langchain-graph-retriever


Namelangchain-graph-retriever JSON
Version 0.4.2 PyPI version JSON
download
home_pageNone
SummaryLangChain retriever for traversing document graphs on top of vector-based similarity search.
upload_time2025-02-07 21:00:47
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords rag graph rag langchain
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "langchain-graph-retriever",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "RAG, graph RAG, langchain",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/d2/dd/d09fcfb785a7ed5641aa3bf1bb4a2cd33421d32cf5b66062b99cc8ea9dde/langchain_graph_retriever-0.4.2.tar.gz",
    "platform": null,
    "description": "# LangChain Graph Retriever\n\nLangChain Graph Retriever is a Python library that supports traversing a document graph on top of vector-based similarity search.\nIt works seamlessly with LangChain's retriever framework and supports various graph traversal strategies for efficient document discovery.\n\n## Features\n\n- **Vector Search**: Perform similarity searches using vector embeddings.\n- **Graph Traversal**: Apply traversal strategies such as breadth-first (Eager) or Maximal Marginal Relevance (MMR) to explore document relationships.\n- **Customizable Strategies**: Easily extend and configure traversal strategies to meet your specific use case.\n- **Multiple Adapters**: Support for various vector stores, including AstraDB, Cassandra, Chroma, OpenSearch, and in-memory storage.\n- **Synchronous and Asynchronous Retrieval**: Supports both sync and async workflows for flexibility in different applications.\n\n## Installation\n\nInstall the library via pip:\n\n```bash\npip install langchain-graph-retriever\n```\n\n## Getting Started\n\nHere is an example of how to use LangChain Graph Retriever:\n\n```python\nfrom langchain_graph_retriever import GraphRetriever\nfrom langchain_core.vectorstores import Chroma\n\n# Initialize the vector store (Chroma in this example)\nvector_store = Chroma(embedding_function=your_embedding_function)\n\n# Create the Graph Retriever\nretriever = GraphRetriever(\n    store=vector_store,\n    # Define edges based on document metadata\n    edges=[(\"keywords\", \"keywords\")],\n)\n\n# Perform a retrieval\ndocuments = retriever.retrieve(\"What is the capital of France?\")\n\n# Print the results\nfor doc in documents:\n    print(doc.page_content)\n```\n\n## License\n\nThis project is licensed under the Apache 2 License. See the LICENSE file for more details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "LangChain retriever for traversing document graphs on top of vector-based similarity search.",
    "version": "0.4.2",
    "project_urls": {
        "Bug Reports": "https://github.com/datastax/graph-rag/issues",
        "GitHub": "https://github.com/datastax/graph-rag",
        "Homepage": "https://datastax.github.io/graph-rag"
    },
    "split_keywords": [
        "rag",
        " graph rag",
        " langchain"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2f0e6d76d95db025949efd3f6489dd6dc70b4ab6c269a8d468d337877fb13c16",
                "md5": "4108335b6bd37b487e79e097f4d65040",
                "sha256": "421cf890c040e92b6045303fbeefc39578caa2906589b10c0cad46d0da4e80ea"
            },
            "downloads": -1,
            "filename": "langchain_graph_retriever-0.4.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4108335b6bd37b487e79e097f4d65040",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 34512,
            "upload_time": "2025-02-07T21:00:45",
            "upload_time_iso_8601": "2025-02-07T21:00:45.992794Z",
            "url": "https://files.pythonhosted.org/packages/2f/0e/6d76d95db025949efd3f6489dd6dc70b4ab6c269a8d468d337877fb13c16/langchain_graph_retriever-0.4.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d2ddd09fcfb785a7ed5641aa3bf1bb4a2cd33421d32cf5b66062b99cc8ea9dde",
                "md5": "1567d3a0bf9f4703e740cd8db37409b3",
                "sha256": "479019b9de7a40c5258e9e93e0b10b431811ebd6ce9af3852c83964c813b6a0d"
            },
            "downloads": -1,
            "filename": "langchain_graph_retriever-0.4.2.tar.gz",
            "has_sig": false,
            "md5_digest": "1567d3a0bf9f4703e740cd8db37409b3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 33466,
            "upload_time": "2025-02-07T21:00:47",
            "upload_time_iso_8601": "2025-02-07T21:00:47.809205Z",
            "url": "https://files.pythonhosted.org/packages/d2/dd/d09fcfb785a7ed5641aa3bf1bb4a2cd33421d32cf5b66062b99cc8ea9dde/langchain_graph_retriever-0.4.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-07 21:00:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "datastax",
    "github_project": "graph-rag",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "langchain-graph-retriever"
}
        
Elapsed time: 0.46255s