spectre — zsh — en

whoami

Spectre — an OTP-native runtime for agents that stay understandable, governable, and recoverable. This site runs on it.

cat manifesto.md

Build one Elixir agent. Give it only the powers it needs.

Spectre gives one supervised agent ownership of its state and lifecycle. Optional spectre_* libraries add capabilities such as memory, planning, model selection, channels, or a browser: they are powers of that same agent, not different agents.

01 / propose

The model never executes

It may propose work; deterministic policies and your application decide what is allowed and when a side effect runs.

02 / compose

Capabilities, not personas

Install only the powers one agent needs. Each package has one job and never becomes a hidden second agent.

03 / evolve

Improvement stays governed

The agent can learn from experience and propose a safer definition; evaluation, review, approval, activation, and rollback remain explicit.

ls -1 posts/ | wc -l 13 github.com/elchemista/ex_blog

$

man spectre

The Spectre philosophy

spectre/README.md

An agent is a supervised system, not a prompt or a costume for a model. Spectre gives each agent one canonical owner for state, explicit messages at every boundary, and recovery designed in from the start — the way OTP treats everything else.

The model proposes

It cannot skip policy, invent authority, or execute a side effect by itself.

Routing is a dial

Choose regex, semantic evidence, or a model; the lifecycle after that choice stays deterministic.

Durable behavior is data

Runtime-authored skills and proposals can reference only operations already registered by the host; data never becomes executable code.

cat POLICY.md

Anything protected crosses one boundary:

  • models and routes may propose work
  • protected work must pass a deterministic policy
  • approval changes state but does not execute the work
  • execution happens only through an explicit host call
  • every terminal outcome is returned as data

A Spectre agent should read like a map, not a magic trick.

support_agent.ex elixir

The whole agent is one module: the model, the router, a protected action, and the policy guarding it.

defmodule MyApp.SupportAgent do
  use Spectre.Agent

  model(MyApp.LLM, purpose: :smart)
  router(via: [:regex, :embedding, :llm_classifier])

  actions MyApp.SupportActions do
    protect(:delete_account, with: :delete_account_confirmation)
  end

  policy :delete_account_confirmation do
    request(:confirm_delete_account)
    accept(:confirmed_delete, regex: ~r/^yes, delete it$/i)
    reject(:cancel_delete, regex: ~r/^(no|cancel)$/i)
    attempts(3, then: :cancel_pending)
  end

  interrupt :HELP, regex: ~r/^(help|menu)$/i do
    reply(:help)
  end
end
$ spectre trace --this-site

Every article below arrived through this path.

one blog agent — one identity · one lifecycle
├── spectre_beam — channel capability
├── spectre_prism — model-selection capability
├── spectre_kinetic — planning capability
├── spectre_lens — browser capability
├── skills — reader · editorial · operations
└── spectre core — routing · state · policy · effects
└── writer → git → ets — the page you are reading
$ why --like-this

Routing is a dial, not a dogma: regex, a dataset, or a full LLM classifier. What happens after the decision stays deterministic.

Borrowed from Phoenix routers, Ecto schemas, Oban workers and OTP supervision trees. Not a framework you disappear into.

No SQL here. GitHub keeps the content, Phoenix serves an ETS projection, and the agent asks before it writes.

github.com/elchemista/ex_blog — this site, open source

$ spectre reflect --propose

man spectre-morph

How an agent can improve itself

Spectre 0.3.2 can record explicitly enabled, redacted experience, inspect the active agent definition, and propose bounded changes to skills or configuration. The proposal is inert data: it cannot publish, approve, or activate itself.

  1. 01 / observe

    Experience

    The host opts in and records bounded evidence with sensitive values redacted.

  2. 02 / reflect

    Reflection

    Spectre compares what was declared, what is active, and what was observed.

  3. 03 / propose

    Proposal

    Forge may suggest a closed change, but that proposal has no authority of its own.

  4. 04 / govern

    Evaluation and activation

    Protected tests, review, approval, activation, and rollback guard every change.

Self-improving does not mean self-authorizing: evaluation, human review when required, activation, and rollback stay outside the model.

ls -1 spectre*

One core, optional powers

10 libraries

cat STACK.md

There is still one agent, one identity, and one lifecycle. The spectre_* packages below are focused libraries you can install as capabilities — memory, planning, browser perception, model choice, channels, or protocols. They do not spawn a cast of specialist agents.

Installing a package only makes a capability available. A Flow, Work, Skill, or policy must still bind it explicitly, and the host keeps authorization and side effects.

spectre foundation · runtime

The OTP-native core: one owner for state, explicit lifecycle and governance. Every optional power plugs into this foundation.

github.com/elchemista/spectre

spectre_mnemonic capability · memory

Semantic memory engine: ETS working memory, durable recall, typed observations and mental models.

github.com/elchemista/spectre_mnemonic

spectre_ledger capability · checkpoints

Append-only durable checkpoints for Spectre agents, so state survives a crash.

github.com/elchemista/spectre_ledger

spectre_kinetic capability · planning

Elixir-first planning toolkit: Action Language in, validated tool calls out. No JSON schema in the prompt.

github.com/elchemista/spectre_kinetic

spectre_pulse capability · protocol

Transport-independent protocol for agents talking to other agents.

github.com/elchemista/spectre_pulse

spectre_directive capability · missions

An embeddable mission loop for Elixir agents.

github.com/elchemista/spectre_directive

spectre_lens capability · browser

Agent-first browser lens for Lightpanda, so an agent can read what it shipped.

github.com/elchemista/spectre_lens

spectre_prism capability · models

Picks the model per request across OpenAI, OpenRouter, Ollama and Gemini, enforcing privacy, context, cost and latency limits before the call.

github.com/elchemista/spectre_prism

spectre_beam capability · channels

The external-channel boundary: it normalizes provider events and delivers messages idempotently.

github.com/elchemista/spectre_beam

spectre_lab capability · debugging

Debug Spectre agents with checkpoint playback and isolated testing tools, away from production.

github.com/elchemista/spectre_lab

$ spectre status --ecosystem

curl -s spectre_ecosystem/status.json

Compatibility with the current core

Every satellite library is rebuilt and tested against the commit that Spectre core is on today. The table is the published result of that run, not a promise: this page reads it once a day and shows exactly what came back.

10 libraries checked 10 passing

elchemista.github.io/spectre_ecosystem — the full report, refreshed by its own scheduled run

Also running under this site: vettore, ex_fastembed, ex_gram.

ls -lat posts/

Latest posts

Notes written while building all of the above.

13 files
posts/en/is-your-ai-agent-ready-for-gdpr.md

cat posts/en/is-your-ai-agent-ready-for-gdpr.md

Is Your AI Agent Really Ready for GDPR?

The easy answer takes a few seconds. The provider is secure, customer data is not used to train the model, and there is a privacy policy on the website. That sounds reassuring until the DPO asks one very simple question.

#AI Governance 10 min en open
posts/en/beam-vm-elixir-serious-ai-agents.md

cat posts/en/beam-vm-elixir-serious-ai-agents.md

BEAM Wasn't Built for AI, but It Feels Made for Serious Agents

When I started building Spectre, choosing Elixir for a project connected to artificial intelligence felt almost provocative. The usual path through the AI world is already well marked. You begin with Python, reach for CU

#Software Development 10 min en open
posts/en/skill-is-not-markdown-file-how-spectre-was-born.md

cat posts/en/skill-is-not-markdown-file-how-spectre-was-born.md

A Skill Is Not a Markdown File: The Reasoning That Led Me to Spectre

When I started thinking about how to build an Agent, skills already existed. Tools such as Codex, Claude, and other agent systems used skills built around Markdown instructions, sometimes accompanied by scripts, tools, a

#Software Development 12 min en open
posts/en/enterprise-agents-spectre-control-security.md

cat posts/en/enterprise-agents-spectre-control-security.md

An Enterprise Agent Is Not a Chatbot with Production Credentials

A chatbot that gets an answer wrong creates an awkward conversation. An Agent with production credentials that gets something wrong creates an incident. The enterprise problem lives in that distance. It does not begin wh

#Software Development 14 min en open
posts/en/deepseek-harness-vs-spectre-plugins-or-kernel.md

cat posts/en/deepseek-harness-vs-spectre-plugins-or-kernel.md

When Even the Laws of Physics Are Plugins: DeepSeek Harness vs Spectre

"Everything is a plugin" is an irresistible sentence for a developer. It promises freedom. Change the model, change the tool registry, change the database, change the loop. If you dislike a choice, replace it through con

#Software Development 14 min en open
posts/en/humans-govern-loop-spectre-streaming-0-3-2.md

cat posts/en/humans-govern-loop-spectre-streaming-0-3-2.md

Humans Should Govern the Loop, Not Run It

We built Agents capable of working for hours. Then we hired a human to press "Continue" every thirty seconds. Congratulations. We automated the work by creating a new job. A daily.dev collection about AI engineering in 2

#Software Development 12 min en open
posts/en/do-not-trust-the-model-test-spectre-agents-like-software.md

cat posts/en/do-not-trust-the-model-test-spectre-agents-like-software.md

Do Not Trust the Model: Test a Spectre Agent Like Software

An agent produced the correct answer. The test passes. But did it call the model three times when none were needed? Did it stage a destructive action before approval? Did it execute the same operation twice after a timeo

#Software Development 15 min en open
posts/en/spectre-morph-build-an-agent-that-can-evolve.md

cat posts/en/spectre-morph-build-an-agent-that-can-evolve.md

Spectre Morph: Build an Agent That Can Evolve Without Rewriting Itself

“A self modifying agent” usually brings the wrong picture to mind. It sounds like a model opening its own source files, rewriting a prompt, adding a tool, and restarting itself with more power than it had a moment ago. T

#Software Development 18 min en open
posts/en/spectre-news-agent-lens-kinetic-action-language.md

cat posts/en/spectre-news-agent-lens-kinetic-action-language.md

Build a Useful Spectre News Agent with Lens, Kinetic, and Action Language

Many agent demos end when the model calls a function. That is enough to show that tool calling works, but it is not enough to show why an agent runtime exists. The interesting problems begin when the function touches the

#Software Development 14 min en open
posts/en/a-turn-is-not-a-model-call-spectre-otp-policies.md

cat posts/en/a-turn-is-not-a-model-call-spectre-otp-policies.md

A Turn Is Not a Model Call: How Spectre Governs Agents with OTP

In many agent frameworks, a turn begins when input reaches a model and ends when the model has finished calling tools and produced an answer. I started Spectre from a different question: At which point does responsibilit

#Software Development 13 min en open
posts/en/the-agent-should-exist-in-code-not-in-the-prompt.md

cat posts/en/the-agent-should-exist-in-code-not-in-the-prompt.md

The Agent Should Exist in Code, Not in the Prompt

Most agents exist primarily inside a prompt. The surrounding application may be written in Python, TypeScript or Elixir, but the agent itself is often a long system message: who it is, what it can do, which rules it must

#Software Development 11 min en open
posts/en/getting-started-with-spectre.md

cat posts/en/getting-started-with-spectre.md

Getting Started with Spectre: Your First Agent Is Not a Loop

Most agent tutorials start with a model call. You send a prompt, describe two tools, print the answer, and the demo works. Spectre asks you to start somewhere else. Before choosing a model, you have to answer a much less

#Software Development 14 min en open
posts/en/building-a-blog-agent-with-spectre.md

cat posts/en/building-a-blog-agent-with-spectre.md

Building a Blog Agent with Spectre, Not Around a Magic Loop

I did not build Spectre because calling an LLM from Elixir was difficult. That part is easy. Send a request, pass some messages, describe a few functions and wait for the model to return a tool call. The problem starts a

#Software Development 11 min en open