langgraph-mcp  by esxr

LangGraph template for universal assistant using Model Context Protocol (MCP)

created 6 months ago
535 stars

Top 60.1% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a Universal Assistant template using LangGraph and the Model Context Protocol (MCP) for seamless integration of LLMs with external data sources and tools. It targets developers building AI applications requiring complex workflows, multi-agent interactions, and dynamic tool invocation, offering a standardized approach to context management.

How It Works

The Universal Assistant employs a multi-agent pattern orchestrated by LangGraph. A router graph, built using build_router_graph.py, indexes MCP server capabilities (tools, prompts, resources) into a vector database for efficient routing. The assistant graph (assistant_graph.py) then decides which agent to use, which in turn selects and invokes the appropriate tool on an MCP server. A generic MCP wrapper (mcp_wrapper.py) utilizes a Strategy Pattern with an abstract MCPSessionFunction to define common interfaces for operations like fetching routing information, retrieving tools, and executing tools, ensuring extensibility.

Quick Start & Requirements

  • Install: pip install -U "langgraph-cli[inmem]" and pip install -e . within the cloned repository.
  • Prerequisites: Python 3.x, OpenAI API key, GitHub Personal Access Token. Milvus Lite is supported for file-based URIs but does not work on Windows; Milvus Server via Docker is recommended for Windows users.
  • Setup: Requires cloning the repository, setting up a virtual environment, and configuring .env with API keys.
  • Links: Project Repository, LangGraph, MCP

Highlighted Details

  • Implements a multi-agent pattern for complex AI workflows.
  • Utilizes LangGraph for graph-based execution and modularity.
  • Leverages MCP for standardized LLM integration with external tools and data.
  • Employs a Strategy Pattern for extensible MCP tool interaction.

Maintenance & Community

The project is maintained by esxr. Further community or roadmap information is not detailed in the README.

Licensing & Compatibility

The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

Milvus Lite, used for the vector database, is not compatible with Windows; users must set up Milvus Server via Docker or adapt the retriever for alternative solutions. The README does not detail specific performance benchmarks or known bugs.

Health Check
Last commit

5 months ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
1
Star History
120 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.