ADK-Rust Framework

repository·main·Indexed 20 days ago

https://github.com/zavora-ai/adk-rust

A high-performance Rust framework for building composable, model-agnostic autonomous AI agents. It includes modular architecture for realtime voice interaction, RAG pipelines, and multi-agent workflows. Key components include adk-acp for Agent Client Protocol integration (supporting both client and server roles), adk-action for programmatic graph node definitions and variable interpolation, and adk-agent for agent implementations.

Tokens
513.5K
Snippets
1.4K
Records
2K
Agent score
62%

What's inside ADK-Rust

  1. Overview of adk-skill

    main

    adk-skill is the engine for specification-driven agent skills, implementing the agentskills.io specification. It allows agents to dynamically configure their behavior, tools, and personas based on structured Markdown definitions.

    Key capabilities include:

    • Discovery: Finding skill definitions in your project.
    • Parsing & Validation: Converting Markdown with YAML frontmatter into machine-readable skill metadata.
    • Indexing: Organizing skills for efficient retrieval.
    • Context Coordination: Helping the runtime inject the correct context and tools based on the active skill.

    This crate is provider-agnostic and integrates with:

    • adk-agent via LlmAgentBuilder::with_skills*
    • adk-runner via Runner::with_auto_skills
    • Custom runtimes via direct API calls.
  2. Overview of adk-agent implementations

    main

    adk-agent provides several specialized agent types for different automation and reasoning needs:

    Core Reasoning Agents

    • LlmAgent: The primary agent powered by LLM reasoning. It supports tools, callbacks, guardrails, and skills.
    • CodeActAgent (feature codeact): An agent that acts by writing and running code. It follows the CodeAct loop where the model emits a script per turn, tools are exposed as callable functions, and the script returns a tagged result. It is language-agnostic via the CodeRuntime interpreter seam.
    • CodingAgent (feature coding): A specialized harness over LlmAgent designed for codebase work. It includes the adk-devtools toolset, a write_todos planning tool, and optimized prompts.
    • CustomAgent: For defining custom logic that does not rely on an LLM.

    Orchestration and Control Flow Agents

    • SequentialAgent: Executes multiple agents in a specific sequence.
    • ParallelAgent: Executes multiple agents concurrently.
    • LoopAgent: Iterates through tasks until an exit condition is met or a maximum number of iterations is reached.
    • ConditionalAgent: Branches execution based on a provided function condition.
    • LlmConditionalAgent: Uses LLM reasoning to perform multi-way routing to various sub-agents.

    Utility Agents

    • LlmEventSummarizer: Uses an LLM to compact context for long conversations, helping manage token limits and context window constraints.
  3. Overview of ADK-Rust features

    main

    ADK-Rust is a production-ready, model-agnostic, and type-safe framework for building high-performance AI agent systems in Rust. Key capabilities include:

    • Agent Types: Supports LLM agents, workflow agents (sequential, parallel, loop), and custom agents.
    • Realtime Voice: Bidirectional audio streaming via OpenAI Realtime API and Gemini Live API.
    • Tool Ecosystem: Typed Rust tools, hosted-provider tools, and full MCP (Model Context Protocol) client/server support.
    • RAG Pipeline: Document chunking, vector embeddings, and semantic search with 6 vector store backends.
    • Security & Commerce: Role-based access control (RBAC), SSO/OAuth, and agentic commerce via ACP and AP2 payment orchestration.
    • Agentic Web Protocol (AWP): Enables agent-native websites with capability manifests and trust levels.
    • Production Readiness: Includes session management, artifact storage, and memory systems with project-scoped isolation.
  4. Overview of adk-model integrations

    main

    The adk-model crate provides LLM integrations for the Rust Agent Development Kit (ADK-Rust). It implements the Llm trait from adk-core, which allows different model providers to be used interchangeably within your agent logic.

    Supported providers include:

    • Gemini: Google's Gemini models (3 Pro, 3 Flash, 2.5 Pro, 2.5 Flash, etc.)
    • OpenAI: GPT-5.1, GPT-5, GPT-5 Mini, GPT-4o (legacy)
    • OpenRouter: Native chat, responses, routing, discovery, and credits APIs
    • xAI: Grok models via OpenAI-compatible API
    • Anthropic: Claude Opus 4.8, 4.7, Sonnet 4.6, Haiku 4.5
    • DeepSeek: DeepSeek R1, V3.1, and DeepSeek-Chat (including thinking mode)
    • Groq: Ultra-fast inference (LLaMA 3.3, Mixtral, Gemma)
    • Ollama: Local LLMs (LLaMA, Mistral, Qwen, Gemma, etc.)
    • Fireworks AI: Fast open-model inference
    • Together AI: Hosted open models
    • Mistral AI: Mistral cloud models
    • Perplexity: Search-augmented LLM (Sonar, etc.)
    • Cerebras: Ultra-fast inference
    • SambaNova: Fast inference
    • Amazon Bedrock: AWS-hosted models via IAM auth
    • Azure AI Inference: Azure-hosted models

    Key capabilities include real-time response streaming and multimodal support (text, images, audio, video, and PDF).

  5. Overview of ADK-Rust Callback Types

    main

    ADK-Rust provides eight callback types to intercept different stages of agent execution. These hooks allow for logging, guardrails, caching, and response modification.

    Callback TypeWhen ExecutedUse Cases
    before_agentBefore agent starts processingInput validation, logging, early termination
    after_agentAfter agent completesResponse modification, logging, cleanup
    before_modelBefore LLM callRequest modification, caching, rate limiting
    after_modelAfter LLM responseResponse filtering, logging, caching
    before_toolBefore tool executionPermission checks, parameter validation
    after_toolAfter tool executionResult modification, logging, ToolOutcome inspection
    after_tool_fullAfter tool execution (V2 rich)Inspect/modify tool args and response directly
    on_tool_errorAfter tool failure (retries exhausted)Fallback results, error recovery
  6. Overview of ADK-Rust Built-in Tools

    main
    ADK-Rust provides several built-in tools that extend agent capabilities without custom implementation. These tools integrate seamlessly with the agent framework. Notably, provider-native tools (like Gemini Google Search or Anthropic Web Search) are declared through the standard Tool API, allowing them to be mixed with custom FunctionTool instances in the same agent.
  7. Overview of Action Node types

    main

    Action nodes are the building blocks of workflow graphs, providing typed operations for common patterns. There are 14 node types available, though some are currently unimplemented or restricted.

    Available Node Types

    • Trigger: Entry point for workflow execution.
    • HTTP: Performs GET, POST, PUT, DELETE, or PATCH requests.
    • Set: Assigns values to workflow variables.
    • Transform: Transforms data using expressions or code.
    • Switch: Conditional branching based on expressions.
    • Loop: Iterates over collections or until a condition is met.
    • Merge: Joins multiple branches.
    • Wait: Pauses execution.
    • Code: Executes arbitrary Rust code (JS/TS not implemented).
    • Notification: Sends Slack, webhook, or push notifications.
    • RSS: Reads/parses RSS/Atom feeds.
    • File: Read, write, and transform files.

    Unimplemented or Restricted Nodes

    • Database: Rejected (no driver integrated).
    • Email: Rejected (IMAP/SMTP not implemented).
    • Code: Only rust is supported; javascript or typescript will be rejected.
    • HTTP: Requires the action-http feature to be enabled.
  8. Overview of adk-graph

    main
    adk-graph is a graph-based workflow orchestration library for the Rust Agent Development Kit (ADK-Rust). Inspired by LangGraph, it allows developers to build complex, stateful agent workflows using directed graphs consisting of nodes and edges. It is designed to be fully compatible with ADK's existing agent system, callbacks, and streaming infrastructure.
  9. Overview of adk-computer-use

    main

    adk-computer-use is an orchestration layer for computer-use-mcp. It provides a safe, governed way to give ADK agents control of a real desktop. It does not perform desktop actuation itself; instead, it manages the workflow, authorization, and evaluation of actions performed by an MCP server.

    Key safety features include:

    • Observe widely, mutate narrowly: Parallel observation with a single mutation node.
    • Preview before acting: Actions are previewed and can require human approval via durable checkpoints.
    • Action-bound approvals: Approvals are pinned to specific action and policy digests.
    • Deterministic cleanup: Reservations are released automatically after verification or on error paths.
    • Identity protection: Principal and tenant information is sourced from adk-auth, preventing prompt-based identity forgery.
  10. Overview of adk-server capabilities

    main

    adk-server provides the HTTP infrastructure required to host and interact with agents built using ADK-Rust. Key features include:

    • REST API: Standard HTTP endpoints for agent interaction.
    • A2A Protocol: Implements the Agent-to-Agent v1.0.0 communication protocol (JSON-RPC 2.0) covering all 11 operations.
    • SSE Streaming: Uses Server-Sent Events for real-time response streaming.
    • Web UI: Includes a built-in chat interface for testing agents.
    • RemoteA2aAgent: Allows connecting to remote agents to use them as sub-agents.
    • Auth Bridge: Bridges authenticated identity from HTTP headers into the agent execution context.
    • Artifacts: Provides binary artifact storage and retrieval scoped to a session.
    • Debug/Tracing: Provides endpoints for trace inspection and graph visualization.
    • YAML Agent Config (requires yaml-agent feature): Enables declarative agent definitions via YAML, supporting:
      • AgentConfigLoader for loading agents from files.
      • HotReloadWatcher for filesystem-based hot reloading with debounce.
      • Environment variable interpolation (e.g., ${VAR} or ${VAR:-default}).
      • Configuration for plugins, sessions, and memory backends.
      • Round-trip serialization via serialize_definition().
  11. Explore the adk-managed module structure

    main

    The adk-managed module provides a supervised runtime for AI agents, including features for checkpointing, event replay, and tool parking. The module is organized into several key functional areas:

    • Runtime & Execution: runtime.rs defines the ManagedAgentRuntime trait, while agent_builder.rs converts a ManagedAgentDef into a runnable agent. session_loop.rs manages the supervised loop (running turns, parking, and checkpointing).
    • State & Persistence: checkpoint.rs handles atomic event and state persistence, and replay.rs enables event replay using from_seq.
    • Types & Data: The types/ directory contains core data structures like ManagedAgentDef, ContentBlock, ModelRef, and event types (UserEvent, SessionEvent).
    • Tooling & Integration: resolver.rs handles ModelRef to Arc<dyn Llm> resolution, and schema_normalization.rs provides cross-provider MCP schema normalization.
  12. Build coding agents with ADK-Rust

    main

    ADK-Rust provides a modular system for building agents that work directly on codebases. Instead of a monolithic framework, it uses specialized components to allow agents to read/edit files, run commands in a sandbox, plan multi-step work, and orchestrate parallel reviewers.

    Core components include:

    • adk-devtools: Provides inner-loop tools like read_file, write_file, edit_file, glob, grep, and bash, all scoped to a specific Workspace directory.
    • CodingAgent (in adk-agent with coding feature): A high-level harness that wires dev tools, a planning write_todos tool, and a minimal prompt onto an LlmAgent.
    • adk-graph: Enables complex workflows, such as fanning out to parallel specialist agents for "ultra-review" patterns.
    • CLI: Native commands for one-shot tasks (code), autonomous goal-seeking (goal), and parallel ultra-review (ultracode).