Skip to content

Agent Runner (Proposed)

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.

SettingValue
TechnologyNode.js + TypeScript + Express
Port9400 (main only)
Statusproposed — no container, not deployed on either estate
RepoDeployd-io/logrite-agent-runner (to be created)
  1. Poll Backend API every 60 seconds for active scheduled agents
  2. Register cron jobs for each agent based on its schedule
  3. Execute agents by calling AI Service /api/v1/chat/sync with:
    • Agent’s system prompt
    • Allowed tools list
    • Context query
  4. Store execution results via Backend API
  5. Alert via Discord if execution triggers alert conditions
MethodPathDescription
GET/healthHealth check
GET/api/v1/statusActive cron jobs, last execution times
POST/api/v1/trigger/:agentIdManually trigger an agent
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
ServiceInteraction
Backend APIRead agent configs, write execution logs
AI ServiceCall /api/v1/chat/sync with agent context
DiscordAlert notifications via webhook

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.

Terminal window
# Start via master CLI
./cli/logrite-manager.js start agent-runner main
# It would be a compose service like every other, with no supervisor
docker logs -f agent-runner
# restart / redeploy through https://management.logrite.ai

See: