> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Ruby Agent SDKで社内メモを要約する

> Ruby Agent SDKでローカルメモを検索し、Phaseo Gateway経由で範囲を絞った要約を返します。

オーケストレーションを別のシステムに任せず、Rubyサービス内に小さな社内メモアシスタントを作る場合に、このレシピを使います。

## 1. SDKを準備する

<Note type="warning">Ruby Agent SDKパッケージはまだRubyGemsで公開されていません。[ソースからのインストール手順](../sdk-reference/ruby/agent-sdk-installation.mdx)に従ってください。</Note>

## 2. メモ検索ツールを定義する

```ruby theme={null}
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
  )
)
```

## 3. エージェントを作成して実行する

```ruby theme={null}
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
```

## このレシピが適する場面

* ツール入力が単純かつ決定的である
* Rubyアプリがすでにデータソースを管理している
* 範囲を絞ったワークフローに使いやすいローカルツールのパターンが必要

## 関連項目

* [Ruby Agent SDK](../sdk-reference/ruby/agent-sdk.mdx)
* [永続化できるエージェントループを作成する](./agent-sdk-durable-loop.mdx)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.