# Agent-to-Agent Setup

When wanting to connect Agents (allowing one agent to call another agent) we use our Functions Skill.

We provide a general Webhook that can be used if you pass the specific Agent API Key you want to call with the function.

The first step is to setup a Function under the Agent (function skill)

<figure><img src="/files/bZfUvxvualyrghkClx9g" alt=""><figcaption></figcaption></figure>

The Function Skill will pass the query to the other Agent for a response and include back into the conversation.\
\
**To Setup:**\
\
Provide Function instructions on when the Agent should call the other agent (essentially added to the core prompt for the AI to look for this prompt to trigger the function)\
\
**Webhook**

To use our generic A2A Webhook - use this URL:

<https://raia.app.n8n.cloud/webhook/e60457a0-bc4a-47c3-bae2-3b690db3dee1>

Provide Function Parameters (which for this use case we just need to pass the question the user prompted into the agent

**Function Instructions:**

```
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "query": {
      "type": "string"
    }
  }
}
```

**Header Variable**

Next, add a Header Variable using the following:\
\
Header Name = Call\_Agent\_APIKEY

Header Value = { API Key of the Agent you want to call }

<figure><img src="/files/Z0OhfBreE8g2FDTF3BDE" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.raiaai.com/integrations/agent-to-agent-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
