How donggwony/publicdata_ai_agent works
This repository is a Daegu commercial-district lifecycle analysis service, exposed through a Streamlit app and an AI agent. The main workflow is a visitor’s question entering the app, passing through the agent’s tool loop, and reaching analysis tools; a separate batch workflow prepares processed data for those tools. The graph also preserves documented analysis capabilities and the MCP entry point. Source excerpts are incomplete, so links to unsampled subsystems are included only where the README or SOURCE INDEX supports them.
Main entry points: tools.py Analysis Tools · build.py Batch Builder · app.py Streamlit App · agent.py Agent Loop
Components 21
User Experience
- Streamlit App
service/app.py - Agent Loop
service/agent.py - Gemini Agent
service/agent_gemini.py - MCP Server
service/mcp_server.py - Tool Schemas
service/core/tool_specs.py - UI Visuals
service/ui_visuals.py
Lifecycle Analysis
- Analysis Tools
service/core/tools.py - Address Matching
service/core/address.py - Market Cycle
service/core/cycle.py - Survival Analysis
service/core/survival.py - Store History
service/core/tools.py - Vacancy Search
service/core/tools.py - Area Comparison
service/core/tools.py - Industry Transitions
service/core/tools.py - Risk Spots
service/core/tools.py
Data Preparation
- Batch Builder
service/pipeline/build.py - External Data Prep
service/pipeline/external.py - Analysis Config
service/config.py - Processed Data
service/data/processed
Other components
- Visitor
- Public Data Sources
Connections 26
- Visitor → Streamlit App: asks
README.md - Streamlit App → Agent Loop: creates agent
service/app.py - Streamlit App → Analysis Tools: calls tools
service/core/tools.py - Streamlit App → UI Visuals: renders with
service/app.py - Agent Loop → Tool Schemas: sends schemas
service/agent.py - Agent Loop → Analysis Tools: dispatches tools
service/agent.py - Agent Loop → Gemini Agent: selects provider
service/agent.py - MCP Server → Analysis Tools: exposes tools
service/mcp_server.py - MCP Server → Tool Schemas: builds schemas
service/mcp_server.py - Analysis Tools → Address Matching: normalizes addresses
service/core/tools.py - Analysis Tools → Market Cycle: classifies cycle
service/core/tools.py - Analysis Tools → Survival Analysis: summarizes survival
service/core/tools.py - Analysis Tools → Store History: provides history
service/core/tools.py - Analysis Tools → Vacancy Search: finds vacancies
service/core/tools.py - Analysis Tools → Area Comparison: compares areas
service/core/tools.py - Analysis Tools → Industry Transitions: analyzes transitions
service/core/tools.py - Analysis Tools → Risk Spots: finds risk spots
service/core/tools.py - Public Data Sources → Batch Builder: provides CSVs
service/pipeline/build.py - Batch Builder → Address Matching: builds address keys
service/pipeline/build.py - Batch Builder → Market Cycle: computes cycle
service/pipeline/build.py - Batch Builder → Survival Analysis: computes survival
service/pipeline/build.py - Batch Builder → Analysis Config: reads settings
service/pipeline/build.py - Batch Builder → Processed Data: writes tables
README.md - External Data Prep → Analysis Config: reads settings
service/pipeline/external.py - Public Data Sources → External Data Prep: supplies inputs
- Analysis Tools → Processed Data: reads tables
service/core/tools.py