What you’ll build
A ReAct agent that can search the web and hold multi-turn conversations with full state persistence. You’ll learn how to:- Scaffold a project with the CLI
- Write a LangGraph agent
- Register it as an assistant
- Create threads and run conversations
- Stream responses in real time
- Inspect thread state and history
Prerequisites
- Python 3.12+
- Docker (for PostgreSQL)
- An OpenAI API key
Step 1: Create the project
.env and set your OPENAI_API_KEY.
Step 2: Understand the project structure
The CLI generated this structure:aegra.json, which tells Aegra where to find your graph:
"agent" key is your graph ID — you’ll use it when creating assistants.
Step 3: Start the server
Step 4: Create an assistant
An assistant is a configured instance of a graph. You create one via the SDK:Step 5: Create a thread and run a conversation
A thread represents a conversation. Each run executes the agent within a thread, and state is persisted between runs.Step 6: Continue the conversation
Because state is persisted in the thread, you can send follow-up messages:Step 7: Inspect thread state
You can inspect the full state of any thread at any point:Step 8: Connect a frontend
Your server implements the Agent Protocol, so you can connect any compatible frontend. Try Agent Chat UI:http://localhost:8000, and you have a full chat interface.