How wolfsbane9513/100x_buildathon works
Project type and purpose
• From the README and file tree, this is a full‐stack Python “Intelligent Report Generator” that:
• Provides an interactive Gradio UI (“interface/app.py”)
• Orchestrates data ingestion (files, MongoDB, SQL)
• Invokes various LLM providers (Ollama local models, OpenAI, Anthropic) via a core Agent
• Post‐processes text, templates, and visualizations
• Renders reports (PDF/DOCX/HTML)
File structure
• Top level:
• report_generator/app – application entrypoint, config, start‐up
• report_generator/interface – Gradio UI definitions
• report_generator/core – business logic: agent, models, data, processors, tools
• report_generator/utils – shared helpers and logging
• root scripts: run.py or test.py, setup.py, requirements.txt
• Patterns:
• Hexagonal/Clean architecture: UI adapters (interface) → application core (core/agent) → domain services (models, processors, data)
• Separation of concerns: data layer vs model abstraction vs processing vs presentation
Key insights from README
• Supports multiple LLM backends (Ollama, OpenAI, Anthropic) configured in core/models
• Flexible data sources managed by connection_manager
• Processors for data cleaning, report formatting, visualization
• Gradio front‐end for user input, progress tracking
a. User & UI Layer
• User’s Web Browser ←→ Gradio Server (interface/app.py)
b. Application Layer
• Application Bootstrap (report_generator/app/main.py & config.py)
• Controller / Agent (core/agent.py) – orchestrates the workflow
c. Domain & Services
• Data Layer (core/data/connection_manager.py) – file loaders, MongoDB, MySQL/PostgreSQL adapters
• Model Provider Layer (core/models/) – abstracts calls to OpenAI, Anthropic, Ollama
• Processing Layer (core/processors/)
– DataPreprocessor
– ReportPreprocessor
– VizProcessor
• Tools (core/tools/tools.py) – utility functions, template rendering
d. Persistence & External Services
• File System (CSV/Excel/JSON upload)
• Databases (MongoDB, MySQL, PostgreSQL)
• External LLM APIs / Local runtime (Ollama daemon)
e. Output Layer
• Report Renderers → PDF, DOCX, HTML
Relationships and Data Flow
1. User interacts with Gradio UI → submits data/config/query
2. UI forwards request to Application Bootstrap → invokes Agent
3. Agent:
a. Calls Data Layer to load/validate data
b. Passes data + query to Model Provider for LLM completion
c. Receives raw LLM response
d. Runs processors: text‐templating, visualization generation
e. Sends processed output to Renderer for final format
4. Renderer writes report to disk or returns file buffer
5. UI streams progress updates and serves final report for download
Architectural patterns and design principles
• Hexagonal / Ports & Adapters:
Core logic (Agent/Processors) depends on abstractions (models, data) via interfaces
• Single Responsibility & Separation of Concerns:
Each folder/module has a distinct role (data access vs LLM clients vs visualization)
• Plugin‐style extensibility:
New data sources or LLM backends can be added under core/data or core/models
Relevant technologies & frameworks
• Python 3.8+
• Gradio (interface)
• Pydantic / dataclasses for schemas (core/models/schemas.py)
• MongoDB / MySQL / PostgreSQL drivers
• Requests / HTTP clients for external APIs
• Ollama CLI for local-model inference