How graniet/kheish works
Main Components
a) Core Agent System
• Four main roles (Proposer, Reviewer, Validator, Formatter) as sub-components
b) Module System
• Following modules in a separate section:
• FileSystem (fs_module)
• Shell (sh_module)
• HTTP (http_module)
• RAG (rag_module)
• SSH (ssh_module)
• Memory (mem_module)
• Vector Store
c) LLM Integration Layer
• Different LLM providers:
• OpenAI
• Anthropic
• Deepseek
• Ollama
• Embeddings service (OpenAI embedder)
d) Database Layer
• Tables identified in migrations:
• Tasks
• Task Outputs
• Task Events
e) API Layer
• REST API endpoints
• Error handling
• Route management
Component Relationships
• Task input → Core Agent
• Core Agent ↔ LLM Providers
• Core Agent ↔ Modules
• Core Agent ↔ Database
• API ↔ Core Agent
• RAG Module ↔ Vector Store
• Core Agent ↔ Role Switching
Specific Elements
a) Task Processing Flow:
1. YAML Configuration Input
2. Agent Initialization
3. Role-based Processing
4. Module Integration
5. Result Generation
b) Data Stores:
• Vector Store for RAG
• PostgreSQL Database
• File System Storage
Important Architectural Patterns to Highlight
• Repository Pattern (shown in db folder structure)
• Module Pattern (for extensibility)
• Event-driven Architecture (task_events)
• Role-based Processing Pipeline
Additional Details
• Version/environment information
• Configuration flow
• Error handling paths
Technical Stack Indicators
• Rust (Primary Language)
• PostgreSQL (Database)
• Vector Store (RAG)
• REST API
• Multiple LLM Provider Support
This system design should emphasize Kheish's unique capability as an intelligent agent that can switch between roles and request modules on demand, rather than just being a simple orchestrator.