How ris3abh/webwiseagent works
Project Type and Purpose
• This is a Python-based, modular, AI-powered personal assistant (CLI application) that orchestrates:
• User interaction via main.py
• Prompt management (prompts/)
• Tooling modules (utils/): web scraping, file I/O, retrieval
• LLM calls (OpenAI API via utils/llm.py)
• Result storage (“results/” folder + file system)
Main Components
a. Frontend / Entry Point
• main.py: CLI or script entry, parses user input and coordinates tasks
b. Orchestrator / Agent Core
• Component that applies decision logic (e.g., “Do I need a web search?”)
• References config (config.py), uses backoff (retry) utilities
c. Prompt Manager
• prompts/system_prompts.py & prompts/user_prompts.py
• Supplies structured messages to the LLM
d. Tooling Modules
• Web Scraper (utils/web_scraper.py): fetches external web data / Google search
• Retrieval (utils/retrival.py): local RAG functionality
• File Handler (utils/file_handler.py): read/write docs
• Backoff Utils (utils/backoff_utils.py): retry logic for API calls
e. LLM Service
• OpenAI API accessed through utils/llm.py
f. Storage
• Local file system: results folder, cached documents, logs
g. External Services
• Google Search or other web APIs via scraper
• OpenAI (cloud LLM)
Interaction & Data Flow
1. User → main.py (CLI)
2. main.py → Orchestrator logic
3. Orchestrator → Prompt Manager (choose system/user prompt)
4. Orchestrator → Tool modules (web_scraper or retrieval) as needed
5. Tool modules → return data → Orchestrator
6. Orchestrator → llm.py (OpenAI API call)
7. llm.py → OpenAI Cloud → llm.py → response → Orchestrator
8. Orchestrator → File Handler (optionally save output)
9. Orchestrator → User (stdout) and results/ (persist)
Architectural Patterns & Principles
• Modular Design: Each tool is a standalone Python module
• Separation of Concerns:
• Prompt logic separated from orchestration
• I/O logic in utils/file_handler.py
• External API logic in utils/llm.py and utils/web_scraper.py
• RAG Ready: Show retrieval module inline, ready to merge external knowledge with generation
Elements to Include on the Canvas
• Results Persistence: show final responses saved under results/ directory.