{"id":47712014,"url":"https://github.com/zeroasterisk/adk-elixir","last_synced_at":"2026-04-12T04:04:25.388Z","repository":{"id":342381745,"uuid":"1173787808","full_name":"zeroasterisk/adk-elixir","owner":"zeroasterisk","description":"ADK (Agent Development Kit) for Elixir — OTP-native agent framework","archived":false,"fork":false,"pushed_at":"2026-03-28T04:08:57.000Z","size":1670,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-28T09:36:05.426Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://zeroasterisk.github.io/adk-elixir/","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeroasterisk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-05T18:48:41.000Z","updated_at":"2026-03-28T04:09:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zeroasterisk/adk-elixir","commit_stats":null,"previous_names":["zeroasterisk/adk-elixir"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zeroasterisk/adk-elixir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2Fadk-elixir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2Fadk-elixir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2Fadk-elixir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2Fadk-elixir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeroasterisk","download_url":"https://codeload.github.com/zeroasterisk/adk-elixir/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2Fadk-elixir/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31312999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-02T18:36:27.440Z","updated_at":"2026-04-02T18:36:28.103Z","avatar_url":"https://github.com/zeroasterisk.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ADK — Agent Development Kit for Elixir\n\n[![Hex.pm](https://img.shields.io/hexpm/v/adk.svg)](https://hex.pm/packages/adk)\n[![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue.svg)](https://zeroasterisk.github.io/adk-elixir/)\n[![CI](https://github.com/zeroasterisk/adk-elixir/actions/workflows/ci.yml/badge.svg)](https://github.com/zeroasterisk/adk-elixir/actions/workflows/ci.yml)\n[![License](https://img.shields.io/hexpm/l/adk.svg)](https://github.com/zeroasterisk/adk-elixir/blob/main/LICENSE)\n\n**OTP-native AI agent framework** inspired by [Google ADK](https://github.com/google/adk-python), built for the BEAM.\n\n## Why Elixir for AI Agents?\n\nPython's ADK is great, but Elixir's runtime was *built* for this:\n\n| Challenge | Python ADK | ADK Elixir |\n|-----------|-----------|------------|\n| **Concurrent agents** | asyncio, threading | Lightweight processes — millions of agents per node |\n| **Crash isolation** | try/except per agent | Process boundaries — one agent crash can't take down others |\n| **Recovery** | Manual retry logic | OTP supervisors — automatic restart with backoff strategies |\n| **Streaming** | Async generators | Native `Stream` + Phoenix PubSub |\n| **State** | Shared dicts, locks | Process isolation — no locks, no mutexes, no race conditions |\n| **Distribution** | Custom networking | Built-in clustering — agents span nodes transparently |\n\n## 📚 Documentation\n\n**[Full docs →](https://zeroasterisk.github.io/adk-elixir/)**\n\n- [Getting Started](https://zeroasterisk.github.io/adk-elixir/getting-started.html)\n- [Core Concepts](https://zeroasterisk.github.io/adk-elixir/concepts.html)\n- [mix adk.new — Project Generator](https://zeroasterisk.github.io/adk-elixir/mix-adk-new.html)\n- [Phoenix Integration](https://zeroasterisk.github.io/adk-elixir/phoenix-integration.html)\n- [Supervision \u0026 OTP](https://zeroasterisk.github.io/adk-elixir/supervision.html)\n- [Dev Server](https://zeroasterisk.github.io/adk-elixir/dev-server.html)\n- [Evaluations](https://zeroasterisk.github.io/adk-elixir/evaluations.html)\n- [Oban Integration](https://zeroasterisk.github.io/adk-elixir/oban-integration.html)\n- [ADK Web Compatibility](https://zeroasterisk.github.io/adk-elixir/adk-web-compatibility.html)\n- [Deployment](https://zeroasterisk.github.io/adk-elixir/deployment.html)\n- [Benchmarks — Elixir vs Python](https://zeroasterisk.github.io/adk-elixir/benchmarks.html)\n\n## Installation\n\nAdd `adk` to your dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:adk, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Quick Start\n\n```elixir\n# Create an agent\nagent = ADK.new(\"assistant\",\n  model: \"gemini-flash-latest\",\n  instruction: \"You are a helpful assistant.\"\n)\n\n# Chat (blocking — returns text)\nADK.chat(agent, \"What is Elixir?\")\n#=\u003e \"Elixir is a dynamic, functional language designed for building scalable...\"\n\n# Run (returns events for full control)\nevents = ADK.run(agent, \"Tell me about OTP\")\n```\n\n### Configure an LLM Backend\n\nBy default, ADK uses a mock LLM for testing. Configure a real backend:\n\n```elixir\n# config/config.exs\nconfig :adk, :llm_backend, ADK.LLM.Gemini\nconfig :adk, :gemini_api_key, System.get_env(\"GEMINI_API_KEY\")\n```\n\nSupported backends: `ADK.LLM.Gemini`, `ADK.LLM.OpenAI`, `ADK.LLM.Anthropic`.\n\n## Agents\n\n### LLM Agent\n\nThe core agent — sends messages to an LLM, handles tool calls, returns events:\n\n```elixir\nagent = ADK.new(\"researcher\",\n  model: \"gemini-flash-latest\",\n  instruction: \"You research topics thoroughly.\",\n  tools: [\u0026MyTools.search/1, \u0026MyTools.summarize/1]\n)\n```\n\n### Sequential Agent\n\nChain agents — output of one feeds into the next:\n\n```elixir\npipeline = ADK.sequential([\n  ADK.new(\"researcher\", instruction: \"Find relevant information.\"),\n  ADK.new(\"writer\", instruction: \"Write a clear summary from the research.\")\n])\n\nADK.chat(pipeline, \"Explain BEAM concurrency\")\n```\n\n### Parallel \u0026 Loop Agents\n\nRun agents concurrently or iteratively:\n\n```elixir\n# Run multiple agents at once, merge results\nparallel = %ADK.Agent.ParallelAgent{\n  name: \"multi\",\n  agents: [researcher, fact_checker, editor]\n}\n\n# Loop until a condition is met\nloop = %ADK.Agent.LoopAgent{\n  name: \"refiner\",\n  agent: editor,\n  max_iterations: 3\n}\n```\n\n## Tools\n\nAny function becomes a tool:\n\n```elixir\ndef get_weather(%{\"city\" =\u003e city}) do\n  %{temp: 72, condition: \"sunny\", city: city}\nend\n\nagent = ADK.new(\"assistant\", tools: [\u0026get_weather/1])\n```\n\nFor richer metadata, use the declarative macro:\n\n```elixir\ndefmodule MyTools.Calculator do\n  use ADK.Tool.Declarative\n\n  @tool name: \"calculate\",\n        description: \"Evaluate a math expression\",\n        parameters: %{\n          \"expression\" =\u003e %{type: \"string\", description: \"Math expression\"}\n        }\n  def run(%{\"expression\" =\u003e expr}, _ctx) do\n    {result, _} = Code.eval_string(expr)\n    %{result: result}\n  end\nend\n```\n\n## Sessions \u0026 Persistence\n\nSessions are GenServers with pluggable storage:\n\n```elixir\n# In-memory (ETS), JSON files, or Ecto (any database)\n{:ok, pid} = ADK.Session.start_link(\n  app_name: \"my_app\",\n  user_id: \"user1\",\n  session_id: \"sess1\",\n  store: {ADK.Session.Store.InMemory, []}\n)\n```\n\n| Store | Backend | Best for |\n|-------|---------|----------|\n| `InMemory` | ETS | Testing, single-node |\n| `JsonFile` | JSON files | Development |\n| `Ecto` | Any database | Production |\n\n## Phoenix Integration\n\nOptional Phoenix helpers — no Phoenix dependency required:\n\n```elixir\n# REST API with SSE streaming\nplug ADK.Phoenix.Controller\n\n# WebSocket real-time communication\nsocket \"/agent\", ADK.Phoenix.Channel\n\n# Drop-in LiveView chat component\nlive \"/chat\", ADK.Phoenix.ChatLive\n```\n\n📖 See the [Phoenix Integration Guide](guides/phoenix-integration.md).\n\n## A2A Protocol\n\nFull [A2A protocol](https://a2a-protocol.org/latest/) support for inter-agent communication:\n\n```elixir\n# Expose as A2A server\nplug ADK.A2A.Server, agent: my_agent, runner: runner\n\n# Call remote agents\n{:ok, result} = ADK.A2A.Client.send_task(\"http://remote:4000\", \"Research OTP\")\n\n# Use remote agents as tools\nresearcher = ADK.A2A.RemoteAgentTool.new(name: \"researcher\", url: \"http://remote:4000\")\n```\n\n## Plugins \u0026 Policies\n\nExtend agent behavior with plugins and safety policies:\n\n```elixir\n# Plugin: automatic retry on LLM reflection\nADK.Plugin.Registry.register(ADK.Plugin.ReflectRetry)\n\n# Policy: control what agents can do\nconfig :adk, :policy, MyApp.SafetyPolicy\n```\n\n## Observability\n\nBuilt-in `:telemetry` events + optional OpenTelemetry:\n\n```elixir\n# All agent/tool/LLM calls emit telemetry events\n:telemetry.attach(\"my-handler\", [:adk, :agent, :run, :stop], \u0026MyHandler.handle/4, nil)\n```\n\n## Mix Tasks\n\n```bash\n# Generate a new ADK project\nmix adk.new my_agent\n\n# Generate Ecto migrations for session persistence\nmix adk.gen.migration\n```\n\n## Architecture\n\n```\nADK.Runner\n├── ADK.Session (GenServer per session)\n├── ADK.Context (immutable invocation context)\n└── ADK.Agent (behaviour)\n    ├── LlmAgent (LLM ↔ tool loop)\n    ├── SequentialAgent (pipeline)\n    ├── ParallelAgent (concurrent)\n    └── LoopAgent (iterative)\n```\n\n## Guides\n\n- [Getting Started](guides/getting-started.md)\n- [Core Concepts](guides/concepts.md)\n- [Project Generator](guides/mix-adk-new.md)\n- [Phoenix Integration](guides/phoenix-integration.md)\n- [Supervision Trees](guides/supervision.md)\n- [Evaluations](guides/evaluations.md)\n\n## License\n\nApache-2.0 — see [LICENSE](https://github.com/zeroasterisk/adk-elixir/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroasterisk%2Fadk-elixir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeroasterisk%2Fadk-elixir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroasterisk%2Fadk-elixir/lists"}