Show HN: OpEx, an agentic LLM toolkit for Elixir (github.com)

🤖 AI Summary
OpEx is a new agentic LLM toolkit for Elixir that brings model-agent workflows, tool calling, and Model Context Protocol (MCP) integration to the BEAM ecosystem. It provides an OpenAI-compatible HTTP client with exponential backoff and automatic retries, a flexible chat loop with hook-based tool execution, and full MCP support over stdio and HTTP transports. Core modules include OpEx.Client (HTTP + retry logic), OpEx.Chat (conversation loop + hooks), OpEx.MCP.{StdioClient, HttpClient, SessionManager, Tools} (local/remote MCP clients, session health monitoring and reconnection, and format utilities). The package is drop-in via mix and demonstrates workflows for spawning MCP servers (e.g., filesystem, Brave Search via npx), creating custom tools, and wiring a tool executor and assistant-message hooks for persistence/metrics. This matters because it lowers the barrier to building production-grade, tool-enabled agents in Elixir: automatic session management, retries for rate limits and transient errors, and a hooks architecture that avoids hard-coded dependencies make it easy to integrate LLMs with databases, search, or local executables. Key technical implications: multi-MCP session management with health checks, conversion helpers between MCP and OpenAI tool formats, three-retry exponential backoff for 429/5xx/transport errors, and extensibility via custom tool executors. Missing but planned: streaming (SSE), telemetry, and supervision helpers. OpEx is MIT-licensed and aimed at teams wanting robust agent patterns on the BEAM.
Loading comments...
loading comments...