How belikejishu/ai-news-summarizer works
Purpose and Entry Points
This is a Python agentic-AI chatbot project built around LangGraph-style workflows. The primary application entry point is app.py; package-level orchestration is likely exposed through src/langgraphagenticai/main.py. It supports basic chat, tool-enabled chat, and AI-news generation flows.
Application and UI Boundary
The user-facing runtime is Streamlit-oriented, with UI loading and result rendering separated from agent logic:
• src/langgraphagenticai/ui/streamlitui/loadui.py
• src/langgraphagenticai/ui/streamlitui/display_result.py
• src/langgraphagenticai/ui/uiconfigfile.py
UI configuration is sourced from src/langgraphagenticai/ui/uiconfigfile.ini. The UI should invoke graph/application APIs rather than directly own LLM or tool decisions.
Graph Orchestration
Workflow construction is centralized in:
• src/langgraphagenticai/graph/graph_builder.py
• src/langgraphagenticai/main.py
This layer is the principal control-flow boundary: it assembles nodes into one or more chatbot/news workflows, routes state between stages, and provides the runnable graph consumed by the UI or top-level app.
Shared Agent State
Cross-node conversation and workflow data is defined in:
• src/langgraphagenticai/state/state.py
This state contract is the primary data boundary between graph stages. Nodes should read incoming messages/request context from it and return state updates, allowing the graph builder—not individual nodes—to manage sequencing and persistence of workflow context.
Agent Nodes and Modes
Distinct behavior is implemented as graph nodes:
• src/langgraphagenticai/nodes/basic_chatbot_node.py
• src/langgraphagenticai/nodes/chatbot_with_Tool_node.py
• src/langgraphagenticai/nodes/ai_news_node.py
The basic chatbot node represents direct LLM response generation. The tool-enabled node adds an agent/tool execution branch. The AI-news node produces curated news-oriented output, likely intended for scheduled or manually triggered summaries.
LLM and Search Integration
External-model access is isolated in:
• src/langgraphagenticai/LLMS/groqllm.py
This is the key provider boundary for Groq-hosted LLM inference. Search capability is encapsulated separately in:
• src/langgraphagenticai/tools/search_tool.py
The expected tool-enabled flow is: user input enters shared state, the graph routes to the chatbot/tool node, that node invokes the Groq LLM and may call the search tool, then the final response is returned through the UI.
Generated News Artifacts and Runtime Dependencies
The repository stores generated or maintained AI-news outputs under:
• AINews/daily_summary.md
• AINews/weekly_summary.md
• AINews/monthly_summary.md
These artifacts form an output boundary for the AI-news workflow, separate from interactive chat responses. Material runtime dependencies are declared in requirements.txt; the core stack implied by the structure includes Python, Streamlit, LangGraph, an LLM provider via Groq, and an external search service/tool.
Main entry points: graph_builder.py Graph builder · ai_news_node.py AI news node · main.py Application API · loadui.py UI loader
Components 17
Entry & UI
- App entry point · Starts the Streamlit-oriented application.
app.py - Application API · Exposes application-level workflow access.
src/langgraphagenticai/main.py - UI loader
src/langgraphagenticai/ui/streamlitui/loadui.py - Result renderer
src/langgraphagenticai/ui/streamlitui/display_result.py - UI config loader
src/langgraphagenticai/ui/uiconfigfile.py - UI settings
src/langgraphagenticai/ui/uiconfigfile.ini
Workflow Core
- Graph builder · Assembles and routes chatbot and news workflows.
src/langgraphagenticai/graph/graph_builder.py - Shared agent state · Carries messages, request context, and node updates.
src/langgraphagenticai/state/state.py
Agent Nodes
- Basic chat node · Generates direct LLM chat responses.
src/langgraphagenticai/nodes/basic_chatbot_node.py - Tool-enabled chat node · Runs LLM-driven chat with optional search.
src/langgraphagenticai/nodes/chatbot_with_Tool_node.py - AI news node · Produces curated AI-news summaries.
src/langgraphagenticai/nodes/ai_news_node.py
Integrations & Outputs
- Groq LLM provider · Isolates hosted model inference.
src/langgraphagenticai/LLMS/groqllm.py - Search tool
src/langgraphagenticai/tools/search_tool.py - Daily summary
AINews/daily_summary.md - Weekly summary
AINews/weekly_summary.md - Monthly summary
AINews/monthly_summary.md - Runtime dependencies · Declares Streamlit, LangGraph, Groq, and related runtime packages.
requirements.txt
Connections 20
- App entry point → UI loader: launches
- App entry point → Application API: uses
- UI loader → UI config loader: loads
- UI config loader → UI settings: reads
- UI loader → Application API: submits requests
- Application API → Graph builder: builds/runs
- Graph builder → Shared agent state: routes state
- Graph builder → Basic chat node: direct chat route
- Graph builder → Tool-enabled chat node: tool chat route
- Graph builder → AI news node: news route
- Basic chat node → Groq LLM provider: inference
- Tool-enabled chat node → Groq LLM provider: agent inference
- Tool-enabled chat node → Search tool: optional search
- AI news node → Groq LLM provider: summary generation
- AI news node → Daily summary: writes
- AI news node → Weekly summary: writes
- AI news node → Monthly summary: writes
- Application API → Result renderer: returns response
- Result renderer → UI loader: renders in UI
- App entry point → Runtime dependencies: runtime environment