{"slug": "show-hn-beamweaver-langchain-deepagents-style-agents-and-workflows-for-elixir", "title": "Show HN: BeamWeaver – LangChain/DeepAgents-style agents and workflows for Elixir", "summary": "BeamWeaver, a new Elixir library, has been released to provide LangChain and LangGraph-style AI agents and durable LLM workflows natively on the BEAM. The library offers agents, graph workflows, streaming, memory, retrieval, and production supervision tools without relying on Python wrappers. Designed for Elixir applications using OTP, Ecto, and telemetry, BeamWeaver enables customer support agents, deep research workflows, and production LLM services with provider fallback and tracing.", "body_md": "Build AI agents and durable LLM workflows in Elixir.\n\nBeamWeaver brings the practical parts of LangChain, LangGraph, and Deep Agents to the BEAM: agents, tools, graph workflows, streaming, memory, persistence, retrieval, provider adapters, tracing, and production supervision.\n\nIt is not a Python wrapper. It is an Elixir library designed for applications that already rely on OTP, supervision trees, Ecto, telemetry, and explicit runtime boundaries.\n\nBeamWeaver is not affiliated with LangChain.\n\nDocumentation: [weavescope.gitbook.io/beam_weaver](https://weavescope.gitbook.io/beam_weaver/)\n\n- Customer support agents with tools, structured output, memory, and traceable model calls.\n- Durable multi-step workflows with graph state, checkpoints, retries, interrupts, time travel, and resumable execution.\n- Deep research and analysis agents with subagents, planning, virtual filesystems, skills, summarization, and sandboxed tool execution.\n- Retrieval pipelines with document loading, splitting, embeddings, vector stores, record managers, and incremental indexing.\n- Production LLM services with provider fallback, rate limits, redaction, telemetry, event streams, and WeaveScope tracing.\n\n| Capability | What BeamWeaver Provides |\n|---|---|\n| Agents | Module-defined agents and runtime-built agents with tools, middleware, structured output, memory, and HITL interrupts. |\n| Graph workflows | LangGraph-style state graphs with reducers, commands, subgraphs, checkpoints, pending writes, and durable execution. |\n| Deep agents | Planning tools, TODO state, virtual filesystems, skills, subagents, async subagents, context engineering, and summarization. |\n| Models | Provider adapters, model profiles, parameter validation, streaming, structured output, token usage, and cost metadata. |\n| Tools | Typed tools, injected runtime arguments, tool nodes, tool middleware, shell/filesystem tools, and tool-call tracing. |\n| Retrieval | Document loaders, text splitters, embeddings, vector stores, retrievers, record managers, and indexing flows. |\n| Persistence | ETS and Ecto-backed memory, checkpoints, caches, record managers, and vector stores. |\n| Observability | Local run trees, typed event streams, telemetry, redaction, and native WeaveScope export. |\n\nBeamWeaver ships checked-in model profiles for current provider families and permissive fallback profiles for future compatible IDs. Use explicit provider prefixes when a model name is ambiguous.\n\n| Provider | Supported examples |\n|---|---|\n| OpenAI | `openai:gpt-5.5` , `openai:gpt-5.5-pro` , `openai:gpt-5.4` , `openai:gpt-5.4-mini` , `openai:gpt-5` , `openai:gpt-4.1` , `openai:text-embedding-3-large` , `openai:text-embedding-3-small` |\n| Anthropic | `anthropic:claude-opus-4-8` , `anthropic:claude-opus-4-7` , `anthropic:claude-opus-4-6` , `anthropic:claude-opus-4-5` , `anthropic:claude-sonnet-4-6` , `anthropic:claude-sonnet-4-5` , `anthropic:claude-haiku-4-5` , `anthropic:claude-fable-5` , `anthropic:claude-mythos-5` |\n| Google Gemini | `google:gemini-3.5-flash` , `google:gemini-3.1-pro-preview` |\n| Moonshot/Kimi | `moonshot:kimi-k2.6` |\n| xAI | `xai:grok-4.3` , `xai:grok-4.20-0309-reasoning` , `xai:grok-4.20-0309-non-reasoning` , `xai:grok-4.20-multi-agent-0309` , `xai:grok-build-0.1` , `xai:v1` embeddings |\n| Test models | Fake chat and embedding models, plus replay transports for deterministic provider tests. |\n\nInspect the exact profile set in your checkout:\n\n```\nmix beam_weaver.models.profiles\n```\n\nAdd BeamWeaver to your application:\n\n```\ndef deps do\n  [\n    {:beam_weaver, \"~> 0.1.0\"}\n  ]\nend\n```\n\nConfigure only the providers you use:\n\n```\nconfig :beam_weaver,\n  openai: [api_key: System.fetch_env!(\"OPENAI_API_KEY\")],\n  anthropic: [api_key: System.fetch_env!(\"ANTHROPIC_API_KEY\")],\n  google: [api_key: System.fetch_env!(\"GOOGLE_API_KEY\")],\n  xai: [api_key: System.fetch_env!(\"XAI_API_KEY\")],\n  moonshot: [api_key: System.fetch_env!(\"MOONSHOT_API_KEY\")]\n```\n\nStart with the module DSL for application code. The DSL keeps the agent's model, prompt, tools, middleware, memory, and harness-style capabilities in one module, so a reader can see what the agent does without chasing a runtime options map. It also makes the common path much easier: adding planning, prompt caching, conversation compaction, overflow recovery, filesystems, or subagents is a declaration instead of custom orchestration code.\n\n```\ndefmodule MyApp.Agents.SupportAgent do\n  use BeamWeaver.Agent\n\n  alias BeamWeaver.Agent.Middleware\n  alias BeamWeaver.Core.Message\n\n  name \"support.reply\"\n  description \"Answer customer support questions with account context.\"\n\n  model \"openai:gpt-5.4-mini\", temperature: 0.2, timeout: 30_000\n  system_prompt \"Answer support questions clearly. Ask for missing details.\"\n\n  # Agent harness capabilities are regular declarations.\n  prompt_caching true\n  compact_conversation true\n  overflow_recovery true\n\n  middleware do\n    use Middleware.TodoList, tool_name: \"write_todos\"\n    use Middleware.ToolCallNormalization\n    use Middleware.StructuredOutputRetry, max_retries: 2\n    use Middleware.ModelRetry, max_retries: 2, initial_delay: 100, retry_on: :transient\n    use Middleware.ToolRetry, max_retries: 1, on_failure: :continue\n    use Middleware.ToolCallLimit, run_limit: 8, exit_behavior: :end\n    use Middleware.ToolSelection, deny: [\"internal_admin_tool\"]\n    use Middleware.PII, detectors: [:email, :credit_card], strategy: :redact\n  end\n\n  def run(question, user) do\n    __MODULE__.invoke(%{messages: [Message.user(question)]},\n      trace: [\n        name: \"support.reply\",\n        user_id: user.id,\n        execution_mode: \"support_reply\",\n        fields: %{account_id: user.account_id}\n      ]\n    )\n  end\nend\n```\n\nUse `BeamWeaver.Agent.build/1`\n\nwhen the agent shape is dynamic or generated from\nconfiguration:\n\n```\ndefmodule MyApp.DynamicSupportAgent do\n  alias BeamWeaver.Agent\n  alias BeamWeaver.Core.Message\n\n  def run(question, user) do\n    model =\n      BeamWeaver.Models.init_chat_model!(\"openai:gpt-5.4-mini\",\n        temperature: 0.2,\n        timeout: 30_000\n      )\n\n    {:ok, agent} =\n      Agent.build(\n        name: \"support.reply\",\n        model: model,\n        system_prompt: \"Answer support questions clearly.\"\n      )\n\n    Agent.invoke(agent, %{messages: [Message.user(question)]},\n      trace: [\n        name: \"support.reply\",\n        user_id: user.id,\n        execution_mode: \"support_reply\",\n        fields: %{account_id: user.account_id}\n      ]\n    )\n  end\nend\n```\n\nTracing is local by default. Add WeaveScope credentials when you want run trees,\nmodel calls, tool calls, token usage, costs, errors, and custom fields in the\nWeaveScope UI. BeamWeaver automatically uses the queued WeaveScope exporter when\nboth `endpoint`\n\nand `api_key`\n\nare configured.\n\n```\nconfig :beam_weaver,\n  weave_scope: [\n    endpoint: \"https://app.weavescope.com\",\n    api_key: System.fetch_env!(\"WEAVESCOPE_API_KEY\")\n  ]\n```\n\nUse `trace:`\n\non agent, graph, runnable, model, or tool calls to attach\napplication identity such as `user_id`\n\n, `thread_id`\n\n, `execution_mode`\n\n, and\nindexed custom fields.\n\nStart here:\n\n[Getting Started](/caudena/beam_weaver/blob/master/docs/getting_started.md)[Thinking In BeamWeaver](/caudena/beam_weaver/blob/master/docs/thinking_in_beamweaver.md)[Workflows And Agents](/caudena/beam_weaver/blob/master/docs/workflows_and_agents.md)[Deep Agents Quickstart](/caudena/beam_weaver/blob/master/docs/deep_agents_quickstart.md)[Models](/caudena/beam_weaver/blob/master/docs/models.md)[Tracing](/caudena/beam_weaver/blob/master/docs/tracing.md)[Going To Production](/caudena/beam_weaver/blob/master/docs/going_to_production.md)\n\nCore guides:\n\n[Agents](/caudena/beam_weaver/blob/master/docs/agents.md)[Graph](/caudena/beam_weaver/blob/master/docs/graph.md)[Tools](/caudena/beam_weaver/blob/master/docs/tools.md)[Messages](/caudena/beam_weaver/blob/master/docs/messages.md)[Middleware](/caudena/beam_weaver/blob/master/docs/middleware.md)[Structured Output](/caudena/beam_weaver/blob/master/docs/structured_output.md)[Event Streaming](/caudena/beam_weaver/blob/master/docs/event_streaming.md)[Persistence](/caudena/beam_weaver/blob/master/docs/persistence.md)[Memory](/caudena/beam_weaver/blob/master/docs/memory.md)[Retrieval](/caudena/beam_weaver/blob/master/docs/retrieval.md)[Filesystem](/caudena/beam_weaver/blob/master/docs/filesystem.md)[Sandboxes](/caudena/beam_weaver/blob/master/docs/sandboxes.md)[Subagents](/caudena/beam_weaver/blob/master/docs/subagents.md)[Human-In-The-Loop](/caudena/beam_weaver/blob/master/docs/human_in_the_loop.md)\n\nProvider guides:", "url": "https://wpnews.pro/news/show-hn-beamweaver-langchain-deepagents-style-agents-and-workflows-for-elixir", "canonical_source": "https://github.com/caudena/beam_weaver", "published_at": "2026-06-12 12:46:51+00:00", "updated_at": "2026-06-12 12:48:37.537728+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "large-language-models", "ai-infrastructure", "ai-products"], "entities": ["BeamWeaver", "LangChain", "LangGraph", "Deep Agents", "Elixir", "BEAM", "OTP", "WeaveScope"], "alternates": {"html": "https://wpnews.pro/news/show-hn-beamweaver-langchain-deepagents-style-agents-and-workflows-for-elixir", "markdown": "https://wpnews.pro/news/show-hn-beamweaver-langchain-deepagents-style-agents-and-workflows-for-elixir.md", "text": "https://wpnews.pro/news/show-hn-beamweaver-langchain-deepagents-style-agents-and-workflows-for-elixir.txt", "jsonld": "https://wpnews.pro/news/show-hn-beamweaver-langchain-deepagents-style-agents-and-workflows-for-elixir.jsonld"}}