# Development Guide

#### Step 1: Initialize the Framework

Initialize the DeAI framework with the following code:

```jsx
const deAI = new deAIMultiAgent({ config: { ... } });

```

#### Step 2: Add Agents

Define and add agents to the framework:

```jsx
deAI.addAgent(
  new BedrockLLMAgent({
    name: "Trading Agent",
    description: "Executes trades based on recommendations."
  })
);

deAI.addAgent(
  new BedrockLLMAgent({
    name: "Market Agent",
    description: "Focuses on trends and opportunities in Web3 and crypto."
  })
);

```

#### Step 3: Handle Requests

Route user queries to the appropriate agent:

```jsx
async function main() {
  try {
const response = await deAI.routeRequest(query, userId, sessionId);	console.log("\\n** RESPONSE DETAILS **\\n");
console.log("Agent Information:");
console.log(`  > Agent ID        : ${response.metadata.agentId}`);
console.log(`  > Agent Name      : ${response.metadata.agentName}`);

console.log("\\nUser Information:");
console.log(`  > User Input      : ${response.metadata.userInput}`);
console.log(`  > User ID         : ${response.metadata.userId}`);
console.log(`  > Session ID      : ${response.metadata.sessionId}`);

console.log("\\nAdditional Parameters:");
console.log(`  > ${JSON.stringify(response.metadata.additionalParams, null, 2)}`);

console.log("\\nResponse Output:");
console.log(`  > ${response.output}\\n`);
} catch (error) {
    console.error("An error occurred:", error);
  }
}

main();

```


---

# 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://dar-open-network.gitbook.io/developers/deai/multi-agent-framework/development-guide.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.
