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

# Neuron AI

> PHP の Neuron AI エージェントから Web を検索し、ページを Markdown として取得します

<Note>
  **Neuron AI 公式ドキュメント:** [docs.neuron-ai.dev/agent/tools](https://docs.neuron-ai.dev/agent/tools)

  Firecrawl を使って、PHP エージェントに Web 検索とページ読み取りの機能を追加します
</Note>

<h2 id="overview">
  概要
</h2>

[Neuron AI](https://neuron-ai.dev) は PHP 向けのエージェントフレームワークです。Firecrawl ツールキットが同梱されているため、Neuron の Agent は実行中にウェブを検索し、任意のページをクリーンな Markdown として読み取れます。

<h2 id="quick-start">
  クイックスタート
</h2>

1. Neuron AI 4.1.3 以降をインストールします：

```bash theme={null}
composer require neuron-core/neuron-ai:^4.1.3
```

2. [Firecrawl ダッシュボード](https://www.firecrawl.dev/app/api-keys)でAPIキーを取得し、`FIRECRAWL_API_KEY` として設定します
3. Agent にツールキットを追加します：

```php theme={null}
namespace App\Neuron;

use NeuronAI\Agent\Agent;
use NeuronAI\Tools\Toolkits\Firecrawl\FirecrawlToolkit;

class ResearchAgent extends Agent
{
    ...

    protected function tools(): array
    {
        return [
            FirecrawlToolkit::make(
                key: getenv('FIRECRAWL_API_KEY')
            ),
        ];
    }
}
```

<h2 id="tools">
  ツール
</h2>

| ツール | Agent から見える名前 | 機能 |
| - | - | - |
| `FirecrawlSearchTool` | `web_search` | Web を検索します (Agent が要求した場合はニュースを検索) 。期間も任意で指定できます |
| `FirecrawlScrapeTool` | `url_reader` | ページのメインコンテンツを Markdown 形式で返します |

いずれかのツールを単独で追加することもできます。例: `FirecrawlSearchTool::make(key: getenv('FIRECRAWL_API_KEY'))`

<h2 id="get-page-content-with-each-search-result">
  検索結果ごとにページのコンテンツを取得する
</h2>

デフォルトでは、検索は各結果のタイトル、URL、説明を返します。`scrapeOptions` を渡すと、各結果にページ全体の Markdown も含まれるため、Agent がページを読むために追加の呼び出しを行う必要がなくなります。

```php theme={null}
use NeuronAI\Tools\Toolkits\Firecrawl\FirecrawlSearchTool;

FirecrawlSearchTool::make(key: getenv('FIRECRAWL_API_KEY'))->withOptions([
    'limit' => 5,
    'scrapeOptions' => [
        'formats' => ['markdown'],
        'onlyMainContent' => true,
    ],
]);
```

`withOptions()` はデフォルト値を置き換えるもので、任意の[検索パラメータ](/ja/api-reference/endpoint/search)を指定できます。検索クエリは常に Agent 側から渡されます。

<h2 id="resources">
  参考リソース
</h2>

* [Neuron AI のツールとツールキット](https://docs.neuron-ai.dev/agent/tools)
* [Firecrawl Search ドキュメント](/ja/features/search)
* [Firecrawl Scrape ドキュメント](/ja/features/scrape)


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