symbiont_ex/lib/symbiont.ex

40 lines
1.2 KiB
Elixir

defmodule Symbiont do
@moduledoc """
Symbiont — Self-sustaining AI orchestrator on the BEAM.
Replaces the original Python implementation with an Elixir/OTP system
that leverages supervision trees, GenServers, and the BEAM's fault
tolerance to provide a more resilient orchestration layer.
## Architecture
The system is built around these core processes:
- `Symbiont.Ledger` — Append-only JSONL cost log (GenServer)
- `Symbiont.Queue` — Persistent task queue (GenServer)
- `Symbiont.Heartbeat` — Periodic health checks (GenServer with timer)
- `Symbiont.Router` — Task classification (stateless module)
- `Symbiont.Dispatcher` — Claude CLI wrapper (stateless module)
- `Symbiont.API` — HTTP endpoints (Plug + Bandit)
## Quick Start
# Start the application
mix run --no-halt
# Submit a task via API
curl -X POST http://localhost:8111/task \\
-H "Content-Type: application/json" \\
-d '{"task": "Summarize this email"}'
# Check status
curl http://localhost:8111/status
"""
@doc "Return the version string."
def version, do: "0.1.0"
@doc "Return the runtime identifier."
def runtime, do: "elixir/otp-#{System.otp_release()}"
end