This repository was archived by the owner on Oct 1, 2026. It is now read-only.
Repository navigation
AAPP 929 - ADK template schema design document #40
Draft
jshah-do
wants to merge
2
commits into
main
Choose a base branch
from
jshah/template-schema-design
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| # ADK Template Schema Design | ||
|
|
||
| ## Problem | ||
|
|
||
| The current [gradient-adk-templates](https://github.com/digitalocean/gradient-adk-templates) repository contains example agents, not true reusable templates. Users must clone folders and manually modify code or config values to create agents. | ||
|
|
||
| ## Goal | ||
|
|
||
| Define a schema-driven template system that allows users to create ADK agents without writing code, consumed consistently by: | ||
|
|
||
| - **ADK CLI** — `gradient agent create --template <name>` prompts for parameters in the terminal | ||
| - **Console UI** — renders the schema as a web form | ||
| - **Genie / MCP** — exposes templates as tool parameters | ||
|
|
||
| The schema is a single source of truth: one definition, three surfaces. | ||
|
|
||
| ## Schema Location | ||
|
|
||
| The canonical home for template schemas is the **public API schema** (Jenni API). Template definitions and user-provided values will be stored in the database, served via API endpoints. The ADK CLI and Console will consume templates through these endpoints. | ||
|
|
||
| ## Template Schema Specification | ||
|
|
||
| ### Top-Level Fields | ||
|
|
||
| | Field | Type | Required | Description | | ||
| |-------|------|----------|-------------| | ||
| | `schema_version` | string | yes | Schema format version (e.g. `v1`) | | ||
| | `template_id` | string | yes | Unique identifier for the template | | ||
| | `name` | string | yes | Human-readable template name | | ||
| | `description` | string | yes | What this template does | | ||
| | `category` | string | yes | Template category (e.g. `rag`, `function-calling`, `multi-agent`) | | ||
| | `parameters` | array | yes | User-configurable inputs | | ||
| | `secrets` | array | no | Required credentials and environment variables | | ||
| | `agent_config` | object | yes | Agent configuration with `${parameter}` substitution | | ||
| | `metadata` | object | no | Tags, ownership, and other metadata | | ||
|
|
||
| ### Parameter Fields | ||
|
|
||
| Each entry in `parameters` describes one user-facing input: | ||
|
|
||
| | Field | Type | Required | Description | | ||
| |-------|------|----------|-------------| | ||
| | `name` | string | yes | Parameter identifier (used in `${...}` substitution) | | ||
| | `label` | string | yes | Display label for CLI prompt or form field | | ||
| | `type` | string | yes | Input type (see supported types below) | | ||
| | `required` | boolean | yes | Whether the user must provide a value | | ||
| | `multiple` | boolean | no | If true, the parameter accepts zero, one, or many values (e.g. multiple KBs, multiple tools). Default false. | | ||
| | `default` | any | no | Default value if user doesn't provide one | | ||
| | `description` | string | no | Help text shown to the user | | ||
| | `source` | string | no | Dynamic data source (e.g. `serverless_inference_models`) | | ||
| | `resource_type` | string | no | For `resource_select` — the DO resource type to list | | ||
| | `options` | array | no | For `select` — static list of allowed values | | ||
|
|
||
| ### Supported Parameter Types | ||
|
|
||
| | Type | Description | Rendered as | | ||
| |------|-------------|-------------| | ||
| | `string` | Single-line text input | Text field | | ||
| | `textarea` | Multi-line text input | Text area | | ||
| | `select` | Pick one from a list | Dropdown | | ||
| | `resource_select` | Pick a DigitalOcean resource from the user's account | Resource picker | | ||
| | `tool_select` | Select function tools for the agent | Tool picker (TBD — pending clarification on UX) | | ||
|
|
||
| ### Secrets | ||
|
|
||
| Templates require credentials that are handled separately from regular parameters — they are masked, stored securely, and never displayed back to the user. | ||
|
|
||
| Each entry in `secrets` declares a required environment variable: | ||
|
|
||
| | Field | Type | Required | Description | | ||
| |-------|------|----------|-------------| | ||
| | `env` | string | yes | Environment variable name | | ||
| | `label` | string | yes | Display label for the user | | ||
| | `description` | string | no | Help text explaining what the secret is for | | ||
| | `required` | boolean | yes | Whether the secret must be provided | | ||
|
|
||
| ### `agent_config` | ||
|
|
||
| A normalized representation of the agent's configuration, independent of the underlying framework or code. Parameters are injected via `${parameter_name}` substitution. | ||
|
|
||
| Consumers (CLI, Console, renderer) interpret this config to produce the appropriate code and deployment artifacts. The rendering layer is a separate design step. | ||
|
|
||
| ## Example: Knowledge Base RAG Template | ||
|
|
||
|
|
||
|
|
||
| ```yaml | ||
| schema_version: v1 | ||
| template_id: knowledge-base-rag | ||
| name: Knowledge Base RAG Agent | ||
| description: Answer questions using selected knowledge bases. | ||
| category: rag | ||
|
|
||
| parameters: | ||
| - name: model | ||
| label: Model | ||
| type: select | ||
| required: true | ||
| source: serverless_inference_models | ||
| description: Model used for inference through Serverless Inference. | ||
|
|
||
| - name: knowledge_base_ids | ||
| label: Knowledge Bases | ||
| type: resource_select | ||
| resource_type: knowledge_base | ||
| multiple: true | ||
| required: false | ||
| description: Knowledge bases this agent can query. | ||
|
|
||
| - name: system_prompt | ||
| label: System Prompt | ||
| type: textarea | ||
| required: false | ||
| default: You are a helpful assistant. | ||
| description: System instructions for the agent. | ||
|
|
||
| - name: tools | ||
| label: Function Tools | ||
| type: tool_select | ||
| multiple: true | ||
| required: false | ||
| description: Tools the agent can call during execution. | ||
|
|
||
| secrets: | ||
| - env: GRADIENT_MODEL_ACCESS_KEY | ||
| label: Gradient Model Access Key | ||
| required: true | ||
| description: API key for Serverless Inference model access. | ||
|
|
||
| - env: DIGITALOCEAN_API_TOKEN | ||
| label: DigitalOcean API Token | ||
| required: true | ||
| description: API token for accessing DigitalOcean resources. | ||
|
|
||
| agent_config: | ||
| model: ${model} | ||
| prompt: | ||
| system: ${system_prompt} | ||
| retrieval: | ||
| knowledge_base_ids: ${knowledge_base_ids} | ||
| tools: ${tools} | ||
|
|
||
| metadata: | ||
| owner: adk | ||
| tags: | ||
| - rag | ||
| - knowledge-base | ||
| ``` | ||
|
|
||
| ## Open Questions | ||
|
|
||
| - **`tool_select` UX**: Should users select from existing tools on the platform, or define new tools inline (URL, name, description, parameters)? Pending clarification. | ||
| - **Validation rules**: Parameters like agent names need constraints (e.g. `^[a-zA-Z0-9_-]+$`, max length). A `validation` field on parameters could support this. | ||
| - **Agent-to-Agent (A2A) routing**: Deferred to phase 2. Data gathering on console agent-to-agent usage is in progress to determine if this capability needs to be carried forward. | ||
|
|
||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each agent can only have
Make sure we address these requirements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it . I have updated it here