Architecture - devdattatalele/Krya.ai GitHub Wiki
Architecture
Krya.ai is composed of three main layers:
-
Frontend (Streamlit UI)
- Accepts natural-language prompts
- Displays generated code, logs, and live status
-
Core Service (Automation Engine)
- LLM Interface:
- Sends prompts + system instructions to Google Gemini 2.0 Flash multimodal
- Receives Python code snippets
- Execution Layer:
- Writes code to
output.py
- Runs via
subprocess
(with error capture) - PyAutoGUI scripts for GUI automation
- Writes code to
- Feedback Loop:
- On error: captures traceback
- Re-submits prompt+error to the LLM for refined code
- Retries until success or max attempts
- LLM Interface:
-
Persistence & Logging
- All events and errors logged in
vaxinsight.log
(RotatingFileHandler) - Session history kept in memory for quick status reporting
- All events and errors logged in
flowchart TD
A[User Prompt] --> B[Streamlit UI]
B --> C[LLM Call (Gemini)]
C --> D[Generate output.py]
D --> E[Execute Code]
E -->|Success| F[Log & Display]
E -->|Error| G[Capture Traceback]
G --> C