Skip to content

Akansha051991/LangGraph-agentic-chatbot

Repository files navigation

πŸ€– Agentic AI Assistant: Groq + LangGraph Orchestration

Streamlit App image

This project demonstrates a production-ready approach to building agentic workflows with persistent memory and real-time tool integration. A high-performance Agentic Assistant built with LangGraph and Groq, optimized for sub-second multi-step reasoning loops. Features a robust multi-tool suiteβ€”including YouTube, Tavily Search, Wikipedia, and Weatherβ€”orchestrated with persistent SQLite memory. Designed for production-ready observability using LangSmith and a real-time streaming interface via Streamlit.

πŸš€ Evolution of the Project

  1. Phase 1: The Core - Built the basic backend and integrated the Llama-3.1-8B model via Groq.
  2. Phase 2: The Experience - Added Streamlit for real-time streaming and a polished UI.
  3. Phase 3: Memory & Logic - Implemented SQLite persistence for resumable chats and complex LangGraph state management.
  4. Phase 4: Professional Grade - Integrated LangSmith for observability and parallel tool-calling.

🌟 Key Features

  • Agentic Workflow: Uses a cyclic graph to handle tool-calling loops (Search, Finance, & Math).
  • Multi-Threaded Persistence: Integrated SqliteSaver allows for multiple independent conversation threads stored in a local SQLite database.
  • Real-Time Streaming: A smooth, ChatGPT-like interface with transparent "Thought" blocks using Streamlit's st.status.
  • Enterprise Observability: Fully integrated with LangSmith for tracing, debugging, and performance monitoring.
  • Secure Architecture: Comprehensive use of environment variables (.env) to protect sensitive API keys.

πŸ› οΈ Tech Stack

  • LLM Engine: Groq (Inference)
  • Logic: LangGraph & LangChain
  • Frontend: Streamlit (Custom CSS & Multi-threading)
  • Database: SQLite (SQLAlchemy / LangGraph Checkpointers)
  • Observability: LangSmith
  • UI : Streamlit
  • Tools: YouTube Search, Tavily, Wikipedia, OpenWeatherMap

πŸ“‚ Project Structure


β”œβ”€β”€ langgraph_tool_backend.py      # Core agent logic & state graph
β”œβ”€β”€ streamlit_frontend_threading.py # UI & multi-threaded execution
β”œβ”€β”€ requirements.txt               # Project dependencies
β”œβ”€β”€ .env.example                   # API key template
└── .gitignore                     # Files to exclude from Git

πŸš€ Getting Started

1. Clone the repository

git clone [https://github.com/YOUR_USERNAME/LangGraph-agentic-chatbot.git](https://github.com/YOUR_USERNAME/LangGraph-agentic-chatbot.git)
cd LangGraph-agentic-chatbot

2. Install Dependencies

pip install -r requirements.txt

3. Setup Environment Variables

Create a .env file in the root directory. Add your credentials (see .env.example for reference):

LangSmith Configuration

  • LANGSMITH_TRACING=true
  • LANGSMITH_API_KEY=your_langsmith_key
  • LANGSMITH_PROJECT="LangGraph-Chatbot"
  • GROQ_API_KEY=your_groq_key
  • TAVILY_API_KEY=your_tavily_key
  • OPENWEATHERMAP_API_KEY=your_weather_key
  • LANGSMITH_API_KEY=your_langsmith_key

4. Run the Application

Start the Streamlit server to launch the interface: streamlit run streamlit_frontend_threading.py

5. Verify Observability

After interacting with the bot, visit your LangSmith dashboard to see the execution traces:

https://eu.smith.langchain.com/

πŸ” Architecture & Observability

By using LangGraph, the agent operates as a state machine. If a tool call fails or returns ambiguous data, the agent can loop back, refine its search, and correct itself. Every "thought" and "action" is logged via LangSmith, providing full transparency into:

  • LLM Reasoning: Exactly why the agent chose a specific tool.
  • Token Usage: Monitoring costs and efficiency.
  • Latency: Identifying bottlenecks in tool response times.

πŸ“– Technical Evolution (Dev Log)

For a deep dive into the technical hurdles, "Overwhelming" moments, and the upcoming MCP (Model Context Protocol) upgrade, check out the:

πŸ‘‰ View the Developer Log (DEV_LOG.md)

About

πŸš€ Agentic Intelligence at Groq Speed. A lightning-fast assistant using LangGraph to orchestrate a multi-tool arsenal (YouTube, Search, Wiki, Weather). Featuring persistent SQLite memory and LangSmith observability for a production-grade experience.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages