· 2 min read · hex.pm/github
Projects

Imp

Imp is declarative, self-improving language-model programming in Elixir: a full port of DSPy to the BEAM.

You describe what each language-model step takes and returns, choose how it thinks, and let an optimizer improve it against examples of what good looks like. You never write a prompt or a parser. Imp builds the prompt from the signature, checks the reply against it, and gives you typed fields back.

triage =
  "issue -> kind: enum[bug,feature,question], summary"
  |> Imp.signature("Triage a GitHub issue.")
  |> Imp.predict(lm: lm)

A horned imp sitting and holding up a hand of playing cards, a smaller imp perched on its tail

DSPy turns each call to a model into a declared, typed function you can measure and improve. On the BEAM, an agent is a process: it keeps its own state, receives messages, and runs under a supervisor alongside the rest of your application. With both, you can build anything from one typed call to many long-running agents, and improve each part by measuring it.

This started as a test of the models’ ability to port things across languages, but it became much more: optimizers that read a program’s failures and rewrite its instructions, agents that call tools, and full MCP and ACP adapters. Basically a whole kit of building blocks for anything you want to make.

Imp is partly a project to see how ambitious a vision I could make real with just me, a couple of agent subscriptions, and a lot of flow state. It turns out the cyberpsychosis is the fun part. The other 80% is the cleanup, bug finding, benchmarking, and writing.

It’s open source, MIT licensed, and hopefully easy to read. Given enough agents, all bugs are shallow, right?

The deepfates/imp repository on GitHub
github.com/deepfates/imp [source]