Imp ports DSPy concepts to the BEAM, providing a declarative framework for building typed, self-improving language-model programs in Elixir. Programs are declared as signatures that describe inputs and outputs; Imp builds prompts from those signatures, validates responses against types, and returns typed fields or errors - so developers don’t write prompts or parsers. It supports single calls and long-running agents, lets you attach tools (ordinary Elixir functions) and reasoning patterns (chain-of-thought, react-style tool use), and runs agents as supervised OTP processes with authorization hooks, event streams, and deadline-limited model calls.
Imp also includes measurement and optimization tooling: you supply labeled train/validation/test sets and a metric, and optimizers such as GEPA (which uses a stronger model to read failures and rewrite instructions), LabeledFewShot, BootstrapFewShot, MIPROv2, SIMBA and GRPO explore or improve programs and whole agent runs. Features include ReqLLM provider support, MCP/ACP integration, RLM for large inputs, CodeAct/program-of-thought shapes, and examples/tools for web fetching. Version 0.5 is experimental, requires Elixir 1.19+, a C++ compiler for erlexec, and reaches models through ReqLLM. The project is MIT licensed and aims to combine DSPy’s measurement-driven improvements with the concurrency and reliability of OTP.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.