A simple conversational AI chatbot built with LangGraph, LangChain, and Claude AI model from Anthropic.
This project implements a basic chatbot using LangGraph for workflow management and the Claude 3.5 Sonnet model from Anthropic as the language model. The chatbot processes user input and generates conversational responses in a streaming manner.
- Simple and straightforward chat interface
- State management with LangGraph
- Integration with Claude 3.5 Sonnet
- Optional LangSmith tracing for monitoring and debugging
- Python 3.8+
- An Anthropic API key
- (Optional) A LangSmith API key for tracing
- Clone this repository:
git clone https://github.com/yourusername/langgraph-chatbot.git
cd langgraph-chatbot- Install dependencies:
pip install -r requirements.txt- Set up environment variables (or you will be prompted for them when running):
export ANTHROPIC_API_KEY="your_anthropic_api_key"
export LANGCHAIN_API_KEY="your_langsmith_api_key" # Optional
export LANGCHAIN_TRACING_V2="true" # Optional
export LANGCHAIN_PROJECT="CourseLanggraph" # OptionalRun the chatbot:
python app.pyType your messages at the prompt. Type "quit" or "q" to exit the conversation.
app.py: Main application file containing the chatbot implementationrequirements.txt: List of required Python packagesREADME.md: This documentation file
To extend this chatbot with additional functionality:
- Modify the
Stateclass to include additional state information - Add new nodes to the graph for different processing steps
- Update the graph's edges to represent the new workflow
Based on LangGraph tutorial: https://www.youtube.com/watch?v=gqvFmK7LpDo
MIT