Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 44 additions & 27 deletions en/docs/get-started/quick-start-ai-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,49 @@ title: "Quick Start: Build an AI Agent"
description: Create an intelligent AI agent powered by LLMs with tool calling.
---

# Quick Start: Build an AI Agent
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Quick start: Build an AI agent

**Time:** Under 15 minutes | **What you'll build:** An AI agent that connects to an LLM, uses tools, and responds to queries through a GraphQL endpoint.

## Prerequisites

- [WSO2 Integrator extension installed](install.md)
- [WSO2 Integrator installed](install.md)
- An OpenAI API key

## Architecture

```
Client GraphQL Service LLM (OpenAI)
│ localhost:8080 │
│ mutation Task(query) │ │
│────────────────────────────►│ prompt + tools │
│ │────────────────────────►│
│ │◄────────────────────────│
│◄────────────────────────────│ response │
│ { data: { task: "..." } } │ │
```
<ThemedImage
alt="Architecture Diagram"
sources={{
light: useBaseUrl('/img/get-started/quick-start-ai-agent/ai-agent-light.svg'),
dark: useBaseUrl('/img/get-started/quick-start-ai-agent/ai-agent-dark.svg'),
}}
/>

## Step 1: Create the Project
## Step 1: Create the project

1. Open the WSO2 Integrator sidebar in VS Code.
2. Click **Create New Integration**.
3. Enter the integration name (e.g., `AIAgent`).
1. Open WSO2 Integrator.
2. Select **Create New Integration**.
3. Enter the integration name (for example, `AIAgent`).

## Step 2: Add a GraphQL Service
## Step 2: Add a GraphQL service

1. Add a **GraphQL Service** artifact.
2. Add a mutation named `task` that accepts a `query: string` parameter.

## Step 3: Configure the Inline Agent
## Step 3: Configure the inline agent

1. Inside the mutation, implement an **Inline Agent**.
2. Configure the model provider (WSO2 default or OpenAI).
3. Set up agent memory and tools.

In code:
<Tabs>
<TabItem value="code" label="Source View" default>

```ballerina
import ballerina/graphql;
Expand All @@ -70,17 +73,31 @@ service /graphql on new graphql:Listener(8080) {
}
```

## Step 4: Configure the API Key
</TabItem>
<TabItem value="ui" label="Design View">

<ThemedImage
alt="Design View"
sources={{
light: useBaseUrl('/img/get-started/quick-start-ai-agent/design-view-light.png'),
dark: useBaseUrl('/img/get-started/quick-start-ai-agent/design-view-dark.png'),
}}
/>

</TabItem>
</Tabs>

## Step 4: Configure the API key

Create a `Config.toml` file:

```toml
openaiKey = "<your-openai-api-key>"
```

## Step 5: Run and Test
## Step 5: Run and test

1. Click **Run** in the toolbar.
1. Select **Run** in the toolbar.
2. Test with curl:

```bash
Expand All @@ -89,9 +106,9 @@ curl -X POST http://localhost:8080/graphql \
-d '{"query": "mutation Task { task(query: \"What is WSO2 Integrator?\") }"}'
```

## What's Next
## What's next

- [GenAI Overview](/docs/genai) -- Full guide to AI capabilities
- [Chat Agents](/docs/genai/agents/chat-agents) -- Build interactive chat agents
- [MCP Servers](/docs/genai/mcp/exposing-mcp-servers) -- Expose tools to AI assistants
- [RAG Applications](/docs/genai/rag/architecture-overview) -- Add knowledge bases to agents
- [GenAI overview](/docs/genai) -- Full guide to AI capabilities
- [Chat agents](/docs/genai/agents/chat-agents) -- Build interactive chat agents
- [MCP servers](/docs/genai/mcp/exposing-mcp-servers) -- Expose tools to AI assistants
- [RAG applications](/docs/genai/rag/architecture-overview) -- Add knowledge bases to agents
71 changes: 44 additions & 27 deletions en/docs/get-started/quick-start-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,49 @@ title: "Quick Start: Integration as API"
description: Build an HTTP service that calls an external API and returns a greeting.
---

# Quick Start: Integration as API
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Quick start: Integration as API

**Time:** Under 10 minutes | **What you'll build:** An HTTP service that receives requests, calls an external API, and returns the response.

## Prerequisites

- [WSO2 Integrator extension installed](install.md)
- [WSO2 Integrator installed](install.md)

## Architecture

```
Client Your Service External API
│ /hello:9090 apis.wso2.com
│ GET /greeting │ │
│──────────────────────────►│ GET /mi-qsg/v1.0 │
│ │───────────────────────►│
│ │◄───────────────────────│
│◄──────────────────────────│ {"message":"Hello"} │
│ {"message":"Hello!!!"} │ │
```
<ThemedImage
alt="Architecture Diagram"
sources={{
light: useBaseUrl('/img/get-started/quick-start-api/api-light.svg'),
dark: useBaseUrl('/img/get-started/quick-start-api/api-dark.svg'),
}}
/>

## Step 1: Create the Project
## Step 1: Create the project

1. Open the WSO2 Integrator sidebar in VS Code.
2. Click **Create New Integration**.
3. Enter the integration name (e.g., `HelloWorld`).
4. Click **Create Integration**.
1. Open WSO2 Integrator.
2. Select **Create New Integration**.
3. Enter the integration name (for example, `HelloWorld`).
4. Select **Create Integration**.

## Step 2: Add an HTTP Service
## Step 2: Add an HTTP service

1. In the design view, add an **HTTP Service** artifact.
2. Set the base path to `/hello` and port to `9090`.
3. Add a **GET** resource at the path `/greeting`.

## Step 3: Connect to an External API
## Step 3: Connect to an external API

1. Add an HTTP connection to `https://apis.wso2.com/zvdz/mi-qsg/v1.0`.
2. In the GET resource, invoke the external API and return its response.

In code, this looks like:
<Tabs>
<TabItem value="code" label="Source View" default>

```ballerina
import ballerina/http;
Expand All @@ -58,9 +61,23 @@ service /hello on new http:Listener(9090) {
}
```

## Step 4: Run and Test
</TabItem>
<TabItem value="ui" label="Design View">

<ThemedImage
alt="Design View"
sources={{
light: useBaseUrl('/img/get-started/quick-start-api/design-view-light.png'),
dark: useBaseUrl('/img/get-started/quick-start-api/design-view-dark.png'),
}}
/>

</TabItem>
</Tabs>

## Step 4: Run and test

1. Click **Run** in the toolbar (top-right corner).
1. Select **Run** in the toolbar.
2. Once the service starts, test with curl:

```bash
Expand All @@ -73,11 +90,11 @@ Expected response:
{"message": "Hello World!!!"}
```

You can also use the built-in **Try It** panel in VS Code to test the endpoint interactively.
You can also use the built-in **Try It** panel in WSO2 Integrator to test the endpoint interactively.

## What's Next
## What's next

- [Quick Start: Automation](quick-start-automation.md) -- Build a scheduled job
- [Quick Start: AI Agent](quick-start-ai-agent.md) -- Build an intelligent agent
- [Quick Start: Event Integration](quick-start-event.md) -- React to messages from Kafka or RabbitMQ
- [Quick start: Automation](quick-start-automation.md) -- Build a scheduled job
- [Quick start: AI agent](quick-start-ai-agent.md) -- Build an intelligent agent
- [Quick start: Event integration](quick-start-event.md) -- React to messages from Kafka or RabbitMQ
- [Tutorials](/docs/tutorials) -- End-to-end walkthroughs and patterns
62 changes: 47 additions & 15 deletions en/docs/get-started/quick-start-automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,43 @@ title: "Quick Start: Build an Automation"
description: Create a scheduled automation that runs tasks on a timer.
---

# Quick Start: Build an Automation
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Quick start: Build an automation

**Time:** Under 10 minutes | **What you'll build:** A scheduled automation that runs tasks on a timer or manual trigger.

Automations are ideal for data synchronization, report generation, and routine maintenance jobs.

## Prerequisites

- [WSO2 Integrator extension installed](install.md)
- [WSO2 Integrator installed](install.md)

## Architecture

## Step 1: Create the Project
<ThemedImage
alt="Architecture Diagram"
sources={{
light: useBaseUrl('/img/get-started/quick-start-automation/automation-light.svg'),
dark: useBaseUrl('/img/get-started/quick-start-automation/automation-dark.svg'),
}}
/>

1. Open the WSO2 Integrator sidebar in VS Code.
2. Click **Create New Integration**.
3. Enter the integration name (e.g., `MyAutomation`).
## Step 1: Create the project

## Step 2: Add an Automation Artifact
1. Open WSO2 Integrator.
2. Select **Create New Integration**.
3. Enter the integration name (for example, `MyAutomation`).

## Step 2: Add an automation artifact

1. In the design view, add an **Automation** artifact.
2. The automation starts with an empty flow.

## Step 3: Add Logic
## Step 3: Add logic

1. Add a **Call Function** node to the flow.
2. Configure it with a simple expression:
Expand All @@ -38,16 +53,19 @@ public function main() {
}
```

## Step 4: Run and Test
## Step 4: Run and test

1. Click **Run** in the toolbar (top-right corner).
1. Select **Run** in the toolbar.
2. The automation executes immediately and prints output to the terminal.
3. Check the terminal output for `Hello World`.

## Scheduling Automations
## Scheduling automations

For production use, configure a cron schedule to trigger the automation periodically:

<Tabs>
<TabItem value="code" label="Source View" default>

```ballerina
import ballerina/task;

Expand All @@ -62,8 +80,22 @@ service on timer {
}
```

## What's Next
</TabItem>
<TabItem value="ui" label="Design View">

<ThemedImage
alt="Design View"
sources={{
light: useBaseUrl('/img/get-started/quick-start-automation/design-view-light.png'),
dark: useBaseUrl('/img/get-started/quick-start-automation/design-view-dark.png'),
}}
/>

</TabItem>
</Tabs>

## What's next

- [Quick Start: Integration as API](quick-start-api.md) -- Build an HTTP service
- [Quick Start: Event Integration](quick-start-event.md) -- React to messages from brokers
- [Quick Start: AI Agent](quick-start-ai-agent.md) -- Build an intelligent agent
- [Quick start: Integration as API](quick-start-api.md) -- Build an HTTP service
- [Quick start: Event integration](quick-start-event.md) -- React to messages from brokers
- [Quick start: AI agent](quick-start-ai-agent.md) -- Build an intelligent agent
Loading