目次
この記事について
本記事は、Agent Builder を使用したデータストア参照型対話エージェントの作成に関する調査記録です。
やりたいこと
Agent Builder を用いたデータストア参照型対話エージェントの作成において、
既存のデータストア機能だとデータ数増加により回答率の低下が発生する為、elastic + dataflow + bigqueryで作成した検索が可能なデータストアを実装したい。
前回の調査日記
あわせて読みたい


AI Agent開発日記 2025/05/01
この記事について 本記事は、Agent Builder を使用したデータストア参照型対話エージェントの作成に関する調査記録です。 やりたいこと Agent Builder を用いたデータス...
agentbuilderのデータストアtoolとしてElastic Cloudで検索できるよう設定する。
- やりたいこと
- Agent Builder Tool から POST メソッドで Elasticsearch への認証付き検索が動作する状態になったが、_source が空になるため原因を調査する。
- 現状
- 最終的に下記のようなスキーマ形式に設定し正しいresponseが得られるようになった。
- 次やりたいこと
- 対話型での検証を行っていなかったため、Tool Description や playbook を整備し、チャット経由でも正常に検索できるか確認したい。
現状のスキーマ
openapi: 3.0.0
info:
title: Elasticsearch Search API
version: v1
servers:
- url: 'elasticのデプロイurl'
paths:
/famous-song/_search:
post:
summary: Search documents in Elasticsearch using POST
description: Executes a search query against the 'famous-song' index using POST request with query in the body. Requires ApiKey authentication via Header.
operationId: searchFamousSongsPost
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
query:
type: object
description: Query in Elasticsearch Query DSL format. Example - {"match_all":{}}
size:
type: integer
description: Number of hits to return.
default: 10
required:
- query
responses:
'200':
description: Successful response with search results.
content:
application/json:
schema:
type: object
properties:
took:
type: integer
timed_out:
type: boolean
_shards:
type: object
hits:
type: object
properties:
total:
type: object
max_score:
type: number
hits:
type: array
items:
type: object
properties:
_index:
type: string
_id:
type: string
_score:
type: number
_source:
type: object
properties:
famous_song:
type: string
name:
type: string
id:
type: string
required:
- famous_song
- name
- id
'400':
description: Bad Request. Invalid request body or query syntax.
'401':
description: Unauthorized. Invalid API Key or authentication setup.
'404':
description: Not Found. Index 'famous-song' not found.
'500':
description: Internal Server Error. Elasticsearch error.
components:
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: Authorization
description: "Elasticsearch API Key authentication. Value should be 'ApiKey YOUR_BASE64_ENCODED_ID:API_KEY'. Provide this full value in Agent Builder auth settings."
security:
- ApiKeyAuth: []