A multi-usecase AI agent application built with LangGraph and Streamlit, demonstrating progressively complex agentic patterns — from a simple chatbot to an autonomous AI news aggregator.
| Usecase | Description |
|---|---|
| Basic Chatbot | Conversational AI with persistent message history |
| Chatbot with Web Search | Agentic chatbot that decides when to search the web using Tavily |
| AI News Aggregator | Autonomous pipeline that fetches, summarizes, and saves AI news |
- LangGraph — Graph-based agent orchestration
- LangChain — LLM orchestration framework
- OpenAI — LLM backend (
gpt-4o,gpt-4o-mini) - Tavily — Web search and news retrieval API
- Streamlit — Web UI
- Python 3.12
Agentic_Chatbot/
├── app.py # Entry point
├── pyproject.toml # Project metadata & dependencies
├── AINews/ # Auto-generated news summaries
│ ├── daily_summary.md
│ └── weekly_summary.md
└── src/
└── langgraph_agentic_ai/
├── main.py # Core app logic
├── LLMs/
│ └── openaillm.py # OpenAI LLM initialization
├── graph/
│ └── graph_builder.py # LangGraph graph construction
├── nodes/
│ ├── basic_chatbot_node.py
│ ├── chatbot_with_tool_node.py
│ └── ai_news_node.py
├── state/
│ └── state.py # Shared graph state schema
├── tools/
│ └── search_tool.py # Tavily search tool wrapper
└── ui/
├── uiconfigfile.ini # UI configuration
├── uiconfigfile.py # Config loader
└── streamlitui/
├── loadui.py # Sidebar controls & inputs
└── display_results.py # Result rendering
The application follows a node-and-graph architecture powered by LangGraph. Each usecase is implemented as a distinct graph topology:
START → Chatbot Node → END
START → Chatbot Node → (tool call?) → Tools Node → Chatbot Node → END
↘ (no tool call) → END
START → Fetch News → Summarize News → Save to File → END
- Python 3.12
- An OpenAI API key — required for all usecases
- A Tavily API key — required for Chatbot with Web and AI News usecases
# Clone the repository
git clone https://github.com/souravnagesh/Agentic-Chatbot.git
cd Agentic_Chatbot
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # macOS/Linux
.venv\Scripts\activate # Windows
# Install dependencies
pip install -e .Note: This project uses
uvfor dependency management. If you haveuvinstalled, runuv syncinstead.
streamlit run app.pyThe app will open at http://localhost:8501.
-
Configure the sidebar:
- Select an LLM (OpenAI)
- Choose a model (
gpt-4o-miniorgpt-4o) - Enter your OpenAI API key
- Select a usecase
-
For Basic Chatbot: Type a message and press Enter.
-
For Chatbot with Web Search: Enter your Tavily API key, then chat. The agent will autonomously decide when to search the web.
-
For AI News: Enter your Tavily API key, select a timeframe (Daily / Weekly / Monthly), and click Fetch Latest AI News. Summaries are saved to
AINews/.
Create a .env file in the project root to pre-load API keys (optional — they can also be entered via the UI):
OPENAI_API_KEY=your_openai_api_key
TAVILY_API_KEY=your_tavily_api_keyThe AI News aggregator saves summaries in Markdown:
# Daily AI News Summary
### 2026-03-26
- GPT-5 released with multimodal capabilities (https://source-url.com)
- ...| Package | Purpose |
|---|---|
langgraph |
Graph-based agent orchestration |
langchain |
LLM orchestration |
langchain-openai |
OpenAI integration |
langchain-community |
Community tools (Tavily) |
streamlit |
Web UI |
tavily-python |
Web search API |
python-dotenv |
.env file support |
pydantic |
Data validation |
This project is open-source and available under the MIT License.



