Sigil

Ship AI products, not agent scripts. One framework — agents, memory, real-time UI, and admin — in 3,000 lines of Elixir.

Docs · Discord · GitHub


One command to a running AI product

mix sigil.new my_app && cd my_app && mix setup && mix sigil.server

That’s it. Open localhost:4000. You have:

Zero agent code. Agents are configured in the database. Change a system prompt, swap a model, assign tools — all from the admin UI. No restart required.


Why Sigil exists

Most AI frameworks give you an LLM wrapper and wish you luck. You still need to build auth, admin, UI, memory, deployment — five libraries stitched together with duct tape.

Sigil gives you the full stack:

Layer What it does
Sigil.LLM Unified interface to Claude, GPT — swap models without changing code
Sigil.Tool Define actions agents can take (book meetings, query DBs, call APIs)
Sigil.Memory Progressive context compression — 80% fewer tokens on long conversations
Sigil.Agent Long-running agents with event sourcing, checkpointing, crash recovery
Sigil.Live Real-time UI over WebSocket — server-rendered, ~2KB client, no React
Sigil.Auth Users, login, sessions, protected routes — built in

Use any layer independently, or all of them together.


Define an agent in 10 lines

defmodule MyApp.GenericAgent do
  use Sigil.Agent

  def init_agent(opts) do
    %{
      llm: {Sigil.LLM.Anthropic, model: opts[:model] || "claude-sonnet-4-20250514"},
      tools: MyApp.ToolRegistry.resolve(opts[:tools] || []),
      system: opts[:system_prompt] || "You are a helpful assistant.",
      memory: :progressive,
      max_turns: 15
    }
  end
end

That’s a generic agent — one module that powers every agent in your app. The system prompt, model, and tools come from the database. Add a new agent? Add a row. No code.

Define a tool

defmodule MyApp.Tools.BookMeeting do
  use Sigil.Tool

  def name, do: "book_meeting"
  def description, do: "Book a meeting on the calendar"

  def params do
    %{
      "type" => "object",
      "properties" => %{
        "title" => %{"type" => "string"},
        "time" => %{"type" => "string", "description" => "ISO 8601 datetime"},
        "email" => %{"type" => "string"}
      },
      "required" => ["title", "time", "email"]
    }
  end

  def call(%{"title" => title, "time" => time, "email" => email}, _ctx) do
    {:ok, "Booked: #{title} at #{time} with #{email}"}
  end
end

Real-time UI (no React, no build step)

Sigil.Live renders HTML on the server and patches the DOM over WebSocket:

defmodule MyApp.ChatLive do
  use Sigil.Live

  def mount(_params, socket) do
    {:ok, Sigil.Live.assign(socket, messages: [], loading: false)}
  end

  def render(assigns) do
    """
    <div id="chat">
      #{render_messages(assigns.messages)}
      <form sigil-event="send">
        <input type="text" name="message" placeholder="Ask anything..." />
      </form>
    </div>
    """
  end
end

Built on the BEAM

Sigil runs on Elixir and the Erlang VM — the same runtime that powers WhatsApp (2B users) and Discord.

Problem Python/TS Sigil
Agent running for hours Redis queues, Celery, workers It’s a process. It just runs.
10,000 concurrent users Kubernetes, message brokers BEAM handles millions of lightweight processes
Agent crashes mid-conversation Data lost, manual restart Supervisor restarts from last checkpoint
Real-time streaming SSE hacks, polling Native WebSocket, built in
Long conversations Manual token counting Progressive memory compression, automatic
Hosting cost $50-200/mo across services $0-7/mo (one server)

New to Elixir? That’s fine. The Getting Started guide takes an afternoon.


Installation

Full app (recommended)

mix sigil.new my_app    # prompts for your Anthropic API key
cd my_app
mix setup               # install deps, create DB, seed
mix sigil.server        # running at localhost:4000

The generator will ask for your Anthropic API key and save it to .env. If you skip it, add it later:

# .env (auto-loaded by mix sigil.server)
ANTHROPIC_API_KEY=sk-ant-your-key-here

Add to an existing Elixir project

# mix.exs
def deps do
  [
    {:sigil, "~> 0.1.0"},

    # Optional — add only what you need:
    {:bandit, "~> 1.6"},           # Web server (for Sigil.Live)
    {:ecto_sql, "~> 3.12"},       # Database (for persistence)
    {:postgrex, "~> 0.19"},       # PostgreSQL
  ]
end
# config/runtime.exs
config :sigil,
  anthropic_api_key: System.get_env("ANTHROPIC_API_KEY")

Roadmap


Community

License

MIT — see LICENSE for details.