1ae932e9472aab2afaf3ebd4532311dac841967f
LangGraph Agent with Conversation Memory and User Confirmation
Installation
python -m venv .venv
source .venv/bin/activate # on Windows use `.venv\Scripts\activate`
pip install -r requirements.txt
Environment Variables
The agent uses the default OpenAI endpoint via langchain. If you want to override, set:
OPENAI_API_KEY– your OpenAI API key.OPENAI_BASE_URL– custom base URL (e.g., for local Ollama).
Running the Agent
python agent.py
The script starts with an empty conversation history. The graph will:
- Retrieve memory (currently just echoes the existing history).
- Invoke a placeholder agent that would normally process the conversation.
- Prompt you to confirm each tool call via Rich console output.
- Continue execution after confirmation.
Extending
Replace agent_node with real LangChain logic, add tools, and integrate an actual LLM model as needed.
Description
Languages
Python
100%