skillfed

langchain-graph-retriever

LangChain retriever for traversing document graphs on top of vector-based similarity search.

langchain-graph-retriever v0.8.0 186.7K downloads/30d#9,979 on PyPI91
Permissive license Apache-2.0 AGING released

What it is and what it does

LangChain Graph Retriever extends LangChain's retriever framework by combining vector-based similarity search with graph traversal. Instead of treating documents as isolated results, it models them as nodes in a graph and explores relationships between them using strategies like breadth-first search or Maximal Marginal Relevance. This is useful for retrieval-augmented generation (RAG) systems where document relationships matter—for example, retrieving not just the most similar document but also semantically related neighbors.

The package depends on LangChain's core abstractions (langchain-core), graph utilities (networkx), and standard Python libraries (pydantic, immutabledict, typing-extensions). It supports both synchronous and asynchronous retrieval workflows and integrates with multiple vector stores. The codebase is in Beta status and has not seen active development recently, though the repository remains maintained.

Use it for:

  • Build RAG pipelines that retrieve semantically related document clusters instead of isolated top-k results.
  • Explore document relationships in knowledge graphs where metadata edges define connections between records.
  • Implement graph-aware search in applications like research paper discovery or knowledge base navigation.
  • Combine vector similarity with graph structure to improve retrieval relevance in multi-hop reasoning tasks.
  • Integrate graph traversal into LangChain agents that need to explore connected document sets.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Retrieves documents from a graph structure using vector similarity search, combining graph traversal strategies with LangChain's retriever framework for efficient document discovery.

Yes, if you need graph-aware document retrieval in a LangChain application and are comfortable with a Beta-status library that has not been actively developed for several months. The package has low install friction, permissive licensing, and no known vulnerabilities. However, verify that the graph traversal strategies and vector store adapters you need are production-ready before deploying to critical systems.

Install

langchain-graph-retriever on PyPI

pip

pip install langchain-graph-retriever

uv

uv add langchain-graph-retriever

poetry

poetry add langchain-graph-retriever

Installing langchain-graph-retriever

Before you install

Low install friction with a pure-Python wheel. Maintenance status is aging—last commit was 2025-05-05 and the package is 497 days past its initial release, though the repository remains active and not archived.

License in practice

Licensed under Apache-2.0 (permissive), allowing commercial use, modification, and distribution with minimal restrictions beyond attribution and liability disclaimers.

Quickstart

pip install langchain-graph-retriever

from langchain_graph_retriever import GraphRetriever
from langchain_core.vectorstores import Chroma

vector_store = Chroma(embedding_function=your_embedding_function)
retriever = GraphRetriever(store=vector_store, edges=[("keywords", "keywords")])
documents = retriever.retrieve("What is the capital of France?")

Requires Python 3.10 or later; also requires a configured vector store (e.g., Chroma) and an embedding function.

Verify before relying

  • Whether graph traversal strategies (Eager, MMR) are fully documented and production-ready.
  • Performance characteristics when working with large document graphs.
  • Support status for the listed vector store adapters (AstraDB, Cassandra, Chroma, OpenSearch).

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 7 — backoff, graph-retriever, immutabledict, langchain-core, networkx, pydantic, typing-extensions
Maintenance aging — 497 days since the last release
Last repo commit
First released
Downloads 186,653/month — #9,979 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: langchain_graph_retriever-0.8.0-py3-none-any.whl

Keywords: RAG, graph RAG, langchain

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Information AnalysisTopic :: Software Development :: Libraries :: Python Modules

Tags

graph-based document retrievalvector search with graph traversallangchain graph ragdocument graph retrieversimilarity search graph explorationlangchain graph navigationrag with graph structure
raggraph-retrievallangchain-integration

More Python Modules packages

Further reading