1. SDKを準備する
Ruby Agent SDKパッケージはまだRubyGemsで公開されていません。ソースからのインストール手順に従ってください。
2. メモ検索ツールを定義する
3. エージェントを作成して実行する
このレシピが適する場面
- ツール入力が単純かつ決定的である
- Rubyアプリがすでにデータソースを管理している
- 範囲を絞ったワークフローに使いやすいローカルツールのパターンが必要
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Ruby Agent SDKでローカルメモを検索し、Phaseo Gateway経由で範囲を絞った要約を返します。
lookup_note = PhaseoAgentSdk.define_tool(
PhaseoAgentSdk::Tool.new(
id: "lookup-note",
description: "Look up one internal note by topic.",
parameters: {
type: "object",
properties: {
topic: { type: "string" },
},
required: ["topic"],
},
execute: lambda do |input, _context|
{
topic: input["topic"],
summary: "Presets centralize routing defaults so app code stays smaller.",
}
end
)
)
agent = PhaseoAgentSdk.create_agent(
id: "notes-agent",
model: "openai/gpt-5.4-nano",
instructions: "Use tools when helpful and answer in one short paragraph.",
tools: [lookup_note]
)
result = agent.run(
input: "Summarize our note about presets.",
client: PhaseoAgentSdk.create_gateway_agent_client
)
puts result.output