This backend uses the LangGraph CLI to serve a LangGraph agent.
-
Install dependencies: It is recommended to use a virtual environment.
pip install -r requirements.txt
-
Set API Key: Export your Thesys API key as an environment variable. Create a new key on the Thesys Console if you haven't already.
export THESYS_API_KEY=sk-th-... -
Run the server: Use the LangGraph CLI to start the development server:
langgraph dev
The server will be available at http://localhost:2024 by default.
The backend is configured via langgraph.json, which points to the compiled graph in graph.py.
- Graph definition:
graph.pycontains theStateGraphlogic. - Tools:
tools.pycontains the tools available to the agent. - Persistence: The LangGraph development server handles thread persistence automatically.
Once the server is running, you can access the interactive API documentation and the LangGraph Studio at:
- http://localhost:2024/docs
- http://localhost:2024 (LangGraph Studio)