When to use it#

langchain-agensgraph is for teams building LLM applications in LangChain 1.x that want AgensGraph to be the single backing store for their graphs, embeddings, conversations, and agent state.

Good fits

  • GraphRAG over your documents. Extract a knowledge graph from text with LLMGraphTransformer, load it with add_graph_documents (one transaction, with provenance edges), and answer questions with AgensCypherQAChain, which generates Cypher against the introspected schema and runs it read-only.

  • Vector and hybrid RAG. Store chunk embeddings in AgensgraphVector and retrieve with semantic search, reciprocal-rank-fusion hybrid search, or MongoDB-style metadata filters — with effective_search_ratio to trade latency for recall. AgensGraphContextRetriever adds each hit’s graph neighbourhood in the same statement.

  • Stateful chat agents. Persist a conversation with AgensChatMessageHistory (optionally windowed) and an agent’s full state with the AgensSaver LangGraph checkpointer, so a thread resumes after a restart or in another process. Keep memories that outlive a thread in AgensStore.

  • Consolidating datastores. Keep the knowledge graph, the vector index, chat history, checkpoints, and long-term memory in one AgensGraph instance instead of running a separate graph DB, vector DB, and cache.

  • Concurrent services. Share one AgensEngine connection pool across a graph store and several vector stores so requests don’t serialize on a single connection.

How it compares

  • Pick langchain-agensgraph when your application is already built on LangChain and you want direct control over the stores, retrievers, and chains.

  • Pick LlamaIndex if you build on LlamaIndex instead.

  • Pick LightRAG or cognee for a turnkey graph-RAG or memory pipeline (ingestion, extraction, and retrieval handled for you) rather than wiring the pieces together yourself.

Consider an alternative when

  • You are not building a Python application — to let an agent such as Claude Desktop use AgensGraph through tools, use the MCP servers.

  • You only need plain Cypher access with no LLM features — the agensgraph-python driver, which this integration is built on, is enough on its own.