Agent Runner (Proposed)
Overview
Section titled “Overview”The Agent Runner is a new Node.js/TypeScript service that enables background agentic AI execution. It polls the Backend API for scheduled agents, registers cron jobs, and fires the AI Service chat API on schedule.
| Setting | Value |
|---|---|
| Technology | Node.js + TypeScript + Express |
| Port | 9400 (main only) |
| Status | proposed — no container, not deployed on either estate |
| Repo | Deployd-io/logrite-agent-runner (to be created) |
Responsibilities
Section titled “Responsibilities”- Poll Backend API every 60 seconds for active scheduled agents
- Register cron jobs for each agent based on its schedule
- Execute agents by calling AI Service
/api/v1/chat/syncwith:- Agent’s system prompt
- Allowed tools list
- Context query
- Store execution results via Backend API
- Alert via Discord if execution triggers alert conditions
Planned API
Section titled “Planned API”| Method | Path | Description |
|---|---|---|
GET | /health | Health check |
GET | /api/v1/status | Active cron jobs, last execution times |
POST | /api/v1/trigger/:agentId | Manually trigger an agent |
Execution Flow
Section titled “Execution Flow”flowchart TD
A[Startup] --> B[Poll Backend for scheduled agents]
B --> C{New agents?}
C -->|Yes| D[Register cron jobs]
C -->|No| E[Wait 60s]
E --> B
D --> F[Cron fires]
F --> G[GET /agents/:id/context from Backend]
G --> H[Build system prompt + toolsAllowed]
H --> I[POST /chat/sync to AI Service]
I --> J[Receive response]
J --> K[POST /agents/:id/executions to Backend]
K --> L{Alert condition met?}
L -->|Yes| M[POST Discord webhook]
L -->|No| N[Done]
M --> N
Integration Points
Section titled “Integration Points”| Service | Interaction |
|---|---|
| Backend API | Read agent configs, write execution logs |
| AI Service | Call /api/v1/chat/sync with agent context |
| Discord | Alert notifications via webhook |
Configuration
Section titled “Configuration”The Agent Runner reads its config from the Backend API — no separate config file needed. Agent schedules, system prompts, and tool permissions are all stored in the Backend database.
Running it (when built)
Section titled “Running it (when built)”# Start via master CLI./cli/logrite-manager.js start agent-runner main
# It would be a compose service like every other, with no supervisordocker logs -f agent-runner# restart / redeploy through https://management.logrite.aiNext Steps
Section titled “Next Steps”See:
- AI Agents: Architecture — Full system design
- AI Agents: Execution Loop — Detailed execution flow
- AI Agents: Roadmap — Implementation phases