Skip to content

albertfsalapi/langgraph-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LangGraph Agent

A conversational AI agent with real-time web search and memory that survives restarts, built as a state graph with LangGraph.

What it does

  • 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

Stack

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

Architecture

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

Installation

git clone https://github.com/albertfsalapi/langgraph-agent
cd langgraph-agent

uv sync
source .venv/bin/activate

cp .env.example .env      # add your API keys

Environment variables

GROQ_API_KEY=
TAVILY_API_KEY=

Both services have a free tier:

Usage

python main.py

Type 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.

Roadmap

  • More tools: calculator, code executor
  • Web interface with Streamlit or Gradio
  • Multi-conversation support with dynamic thread_id
  • Unit tests for graph nodes

About

Conversational AI agent with real-time web search and persistent memory, orchestrated as a state graph with LangGraph.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages