A conversational AI agent with real-time web search and memory that survives restarts, built as a state graph with LangGraph.
- Holds conversations with persistent context, checkpointed to SQLite
- Decides on its own when it needs current information and searches the web via Tavily
- Runs on Llama 3.3 70B through Groq — fast inference on a free tier
- Models the agent as an explicit state graph rather than an ad-hoc loop, so routing between "answer" and "search" is inspectable
| Technology | Role |
|---|---|
| LangGraph | Agent orchestration (state graph) |
| Groq API (Llama 3.3 70B) | Language model |
| Tavily | Real-time web search |
| SQLite | Persistent memory across sessions |
| Python 3.12 + uv | Language and dependency manager |
state.py → Graph state definition (messages, context)
config.py → LLM, tools and memory wiring
graph.py → LangGraph graph: nodes and edges
chat.py → Interactive conversation loop
main.py → Entry point
git clone https://github.com/albertfsalapi/langgraph-agent
cd langgraph-agent
uv sync
source .venv/bin/activate
cp .env.example .env # add your API keysGROQ_API_KEY=
TAVILY_API_KEY=Both services have a free tier:
- Groq — https://console.groq.com
- Tavily — https://app.tavily.com
python main.pyType your message and press Enter. To quit: exit, quit or q.
Conversation history is written to conversations.db automatically and reloaded on the next run.
- More tools: calculator, code executor
- Web interface with Streamlit or Gradio
- Multi-conversation support with dynamic
thread_id - Unit tests for graph nodes