tl;dr
- Agentspace は Google Cloud のエージェント開発プラットフォームで、Custom Agent(Agent Engine)を登録して機能を拡張できる
はじめに
この blog では、Agentspace を使用したエージェント開発について書きます。AI エージェントの開発環境は日々進化しており、適切なツールとフレームワークの選択が開発の効率と品質に影響すると考えています。
今回は、Agentspace において、自ら作成した Agent Engine(Custom Agent)を使用して、自然言語での指示を与えることで、エージェントがタスクを実行する方法を紹介します。
Agentspace の概要
Agentspace は、エージェント開発のためのプラットフォームであり、さまざまなデータソースを統合して、エージェントの作成と管理を容易にします。Agentspace を使用することで、開発者はユーザーのニーズに合わせた Custom Agent を迅速に提供することができます。
2025年7月31日に GA となりました。
Custom Agent の登録
Agentspace は、Custom Agent を登録することで、Agentspace の機能を拡張できます。Custom Agent は、特定のタスクやデータソースに特化したエージェントであり、以下の手順で登録できます。現時点では、Console 上での登録はできないため、CLI を使用して登録します。(2025年8月12日時点)
config.json
の設定
config.json
の設定例は、以下の通りです。Custom Agent の登録時に必要な情報のみを設定します。
{
"project_id": "project-id",
"location": "us-central1",
"app_id": "agentspace-xxxxxxxxxxxxx_yyyyyyyyyyyyy",
"ars_display_name": "my-agent",
"description": "Weather and time answering agent",
"tool_description": "Agent to answer questions about the time and weather in a city.",
"adk_deployment_id": "1234567890123456789",
"auth_id": "",
"api_location": "global",
"re_location": "us-central1"
}
Custom Agent を登録する
(.venv) node ➜ /workspaces/agent_registration_tool (main) $ python3 as_registry_client.py register_agent
Enter icon URI (optional):
INFO:root:Create Agent Command: ['curl', '-X', 'POST', '-H', 'Authorization: Bearer [REDACTED_TOKEN]', '-H', 'Content-Type: application/json', '-H', 'X-Goog-User-Project: [PROJECT_ID]', 'https://discoveryengine.googleapis.com/v1alpha/projects/[PROJECT_ID]/locations/global/collections/default_collection/engines/[ENGINE_ID]/assistants/default_assistant/agents', '-d', '{"displayName": "my-agent", "description": "Weather and time answering agent", "adk_agent_definition": {"tool_settings": {"tool_description": "Agent to answer questions about the time and weather in a city."}, "provisioned_reasoning_engine": {"reasoning_engine": "projects/[PROJECT_ID]/locations/us-central1/reasoningEngines/[ENGINE_ID]"}, "authorizations": []}}']
{
"status_code": 0,
"stdout": "{\n \"name\": \"projects/[PROJECT_NUMBER]/locations/global/collections/default_collection/engines/[ENGINE_ID]/assistants/default_assistant/agents/[AGENT_ID]\",\n \"displayName\": \"my-agent\",\n \"description\": \"Weather and time answering agent\",\n \"createTime\": \"2025-08-12T00:35:52.186193605Z\",\n \"adkAgentDefinition\": {\n \"toolSettings\": {\n \"toolDescription\": \"Agent to answer questions about the time and weather in a city.\"\n },\n \"provisionedReasoningEngine\": {\n \"reasoningEngine\": \"projects/[PROJECT_ID]/locations/us-central1/reasoningEngines/[ENGINE_ID]\"\n }\n },\n \"state\": \"ENABLED\"\n}\n",
"stderr": " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\n 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\n100 382 0 0 100 382 0 316 0:00:01 0:00:01 --:--:-- 316\n100 1038 0 656 100 382 447 260 0:00:01 0:00:01 --:--:-- 708\n",
"agent": {
"name": "projects/[PROJECT_NUMBER]/locations/global/collections/default_collection/engines/[ENGINE_ID]/assistants/default_assistant/agents/[AGENT_ID]",
"displayName": "my-agent",
"description": "Weather and time answering agent",
"createTime": "2025-08-12T00:35:52.186193605Z",
"adkAgentDefinition": {
"toolSettings": {
"toolDescription": "Agent to answer questions about the time and weather in a city."
},
"provisionedReasoningEngine": {
"reasoningEngine": "projects/[PROJECT_ID]/locations/us-central1/reasoningEngines/[ENGINE_ID]"
}
},
"state": "ENABLED"
}
}
(.venv) node ➜ /workspaces/agent_registration_tool (main) $
Summary
Agent Engine を Agentspace へ登録することで、Agentspace の機能を拡張できます。Custom Agent を使用することで、特定のタスクやデータソースに特化したエージェントを迅速に提供できます。
Closing
AI Agent は従来のアプリと異なり、自律性を持たせるが故に、非決定論的な挙動をすることがあります。「決定論的な考え方」と「非決定論的な考え方」の併用は、AI エージェントの開発において重要なポイントだと思います。なぜなら、言語モデルが推論を重ねることで、予期しない結果を生むことがあるからです。現状の AI エージェントの開発においては、非決定論的な挙動を理解し、適切に制御することが求められると考えます。