AgentSea for Elixir
A native Elixir/OTP edition of AgentSea — agents are supervised processes, not objects.
This is the Elixir SDK. The rest of these docs cover the TypeScript/Node packages (@lov3kaizen/agentsea-*). The Elixir edition is a ground-up rewrite that keeps AgentSea's concepts (Agent, Provider, Tool, Memory, Crew, Gateway, …) and discards the TypeScript shapes.
Why Elixir?
Where OTP already solves it, AgentSea deletes the abstraction and uses the primitive. An agent is a GenServer that owns its conversation state; a crew is a DynamicSupervisor with a gen_statem coordinator; delegation is message passing; the auction is a timed fan-out; gateway failover is a restart strategy and a :fuse circuit breaker; and you watch the whole fleet execute live over :telemetry + Phoenix LiveView.
A tool that raises is isolated by a supervised Task and folded into an {:error, _} result fed back to the model — the agent process never dies for a tool fault.
Installation
AgentSea is published to Hex as an umbrella of independent agentsea_* packages — add only the ones you need to your mix.exs:
def deps do
[
{:agentsea_core, "~> 0.1"},
{:agentsea_providers, "~> 0.1"}
]
endThen fetch:
mix deps.getRequires Elixir ~> 1.14 on Erlang/OTP 25+. Every package ships its own docs on HexDocs.
Your first agent
An agent is a supervised process. Configure it with a model and a provider, start it, and run it:
config = %AgentSea.Agent.Config{
name: :assistant,
model: "claude-opus-4-8",
# {provider_module, opts}; the key also reads ANTHROPIC_API_KEY
provider: {AgentSea.Providers.Anthropic, api_key: System.fetch_env!("ANTHROPIC_API_KEY")}
}
{:ok, agent} = AgentSea.Agent.start_link(config)
{:ok, response} = AgentSea.Agent.run(agent, "Explain OTP supervision in one sentence.")
IO.puts(response.content)In a real app you'd start agents under your supervision tree rather than with start_link/1 directly.
The packages
Fourteen focused libraries, each behind a behaviour so adapters are swappable. Click through to the API reference on HexDocs.
| Package | What it does |
|---|---|
agentsea_core | Agent GenServer + run loop; Provider/Tool/Memory behaviours; buffer & summary memory. |
agentsea_providers | Anthropic provider over Req — complete/2 and real SSE stream/2. |
agentsea_crews | Multi-agent coordination; delegation strategies; a gen_statem task-DAG coordinator. |
agentsea_gateway | Strategy routing, :fuse circuit breaking, failover, health tracking, streaming. |
agentsea_web | Phoenix LiveView dashboard + an OpenAI-compatible chat completions endpoint. |
agentsea_structured | Extract a validated Ecto struct from an LLM, with validation-retry. |
agentsea_embeddings | Embedder/VectorStore behaviours; in-memory, pgvector, Qdrant & Pinecone stores; RAG. |
agentsea_bumblebee | In-process Hugging Face embeddings and Whisper STT via Bumblebee + Nx. |
agentsea_ingest | A Broadway document ingestion pipeline: chunk → embed → store. |
agentsea_evaluate | Concurrent eval metrics, including an LLM-as-judge. |
agentsea_mcp | Model Context Protocol client with stdio and streamable-HTTP transports. |
agentsea_surf | A Node/Playwright browser-automation sidecar exposed as agent tools. |
agentsea_voice | TTS/STT behaviours with OpenAI and ElevenLabs adapters. |
agentsea_guardrails | Input/output validation: max-length, blocklist, PII redaction, LLM moderation. |
Where to next
- Agents, Providers, Tools & Memory — the core building blocks.
- Crews — multi-agent coordination and the task DAG.
- Gateway — routing, failover, and the OpenAI-compatible endpoint.
- Embeddings & RAG — vector stores, ingestion, and retrieval.