The Recipe Agent is a LangGraph-based implementation designed to assist users in managing and executing recipe workflows. It leverages the LangGraph framework for building stateful workflows and integrates tools for enhanced functionality. The agent is capable of handling user queries, classifying intents, and executing tools to provide a seamless recipe management experience.
- Intent Classification: Classifies user queries into specific intents such as recipe search or general queries.
- Recipe Confirmation: Confirms recipes with the user before proceeding.
- Tool Execution: Executes tools for tasks like grocery list management.
- MCP Integration: Optionally integrates with Model Context Protocol (MCP) tools for extended functionality.
- State Persistence: Uses a memory-based checkpointer to persist state during workflow interruptions.
rcp-agent/
├── agent/
│ ├── graph.py # Defines the workflow and state graph
│ ├── nodes.py # Contains logic for various nodes
│ ├── state.py # Defines the agent state
│ ├── tools.py # Defines tools used by the agent
├── prompts/
│ ├── chat_prompts.py # Chat-specific prompts
│ ├── system_prompts.py # System-specific prompts
├── main.py # Entry point for running the agent
├── pyproject.toml # Project dependencies and configuration
├── README.md # Project documentation
- Clone the repository:
git clone git@github.com:solmon/rcp-agent.git cd rcp-agent - Set up a virtual environment:
python -m venv venv source venv/bin/activate - Install dependencies:
pip install -r requirements.txt
To run the Recipe Agent, execute the following command:
python main.pyTo enable MCP tools, ensure the langchain_mcp_adapters package is installed and run:
python -c "from agent.graph import run_recipe_agent_with_mcp; import asyncio; asyncio.run(run_recipe_agent_with_mcp('Your query here'))"- Define the node logic in
nodes.py. - Add the node to the workflow in
graph.py.
- Define the tool in
tools.py. - Register the tool in the
recipe_toolslist.
Run the following command to execute tests:
pytestContributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
- LangGraph for the workflow framework.
- Model Context Protocol for agent communication.
- LangChain MCP Adapters for MCP client interactions.