This repository contains multiple specialized agents organized in the following structure:
src/
- graph: code example to build graph and its component without involve any llm
- llm: practice need llm and interact with llm
- agent: based on langchain agent object
- deep: practice on deep agent framework
- Install dependencies, along with the LangGraph CLI, which will be used to run the server.
cd path/to/your/app
pip install -e . "langgraph-cli[inmem]"- (Optional) Customize the code and project as needed. Create a
.envfile if you need to use secrets.
cp .env.example .envIf you want to enable LangSmith tracing, add your LangSmith API key to the .env file.
# .env
LANGSMITH_API_KEY=lsv2...
- Start the LangGraph Server.
langgraph devFor more information on getting started with LangGraph Server, see here.
-
Define runtime context: Modify the
Contextclass in thegraph.pyfile to expose the arguments you want to configure per assistant. For example, in a chatbot application you may want to define a dynamic system prompt or LLM to use. For more information on runtime context in LangGraph, see here. -
Extend the graph: The core logic of the application is defined in graph.py. You can modify this file to add new nodes, edges, or change the flow of information.
While iterating on your graph in LangGraph Studio, you can edit past state and rerun your app from previous states to debug specific nodes. Local changes will be automatically applied via hot reload.
Follow-up requests extend the same thread. You can create an entirely new thread, clearing previous history, using the + button in the top right.
For more advanced features and examples, refer to the LangGraph documentation. These resources can help you adapt this template for your specific use case and build more sophisticated conversational agents.
LangGraph Studio also integrates with LangSmith for more in-depth tracing and collaboration with teammates, allowing you to analyze and optimize your chatbot's performance.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.