Files
task_69a474cdc46fd26feae698…/README.md
T
2026-05-28 11:55:12 +00:00

32 lines
934 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# LangGraph Agent with Conversation Memory and User Confirmation
## Installation
```bash
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
```bash
python agent.py
```
The script starts with an empty conversation history. The graph will:
1. Retrieve memory (currently just echoes the existing history).
2. Invoke a placeholder agent that would normally process the conversation.
3. Prompt you to confirm each tool call via Rich console output.
4. Continue execution after confirmation.
## Extending
Replace `agent_node` with real LangChain logic, add tools, and integrate an actual LLM model as needed.