You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/quickstart/middleware.mdx
+17-6Lines changed: 17 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,31 +1,40 @@
1
1
---
2
2
title: "Middleware"
3
3
description:
4
-
"Connect to existing protocols, in process agents or custom solutions via AG-UI"
4
+
"Connect to existing protocols, in process agents or custom solutions via
5
+
AG-UI"
5
6
---
6
7
7
8
# Introduction
8
9
9
-
A middleware implementation allows you to **translate existing protocols and applications to AG-UI events**. This approach creates a bridge between your existing system and AG-UI, making it perfect for adding agent capabilities to current applications.
10
+
A middleware implementation allows you to **translate existing protocols and
11
+
applications to AG-UI events**. This approach creates a bridge between your
12
+
existing system and AG-UI, making it perfect for adding agent capabilities to
13
+
current applications.
10
14
11
15
## When to use a middleware implementation
12
-
Middleware is the flexible option. It allows you to translate existing protocols and applications to AG-UI events
13
-
creating a bridge between your existing system and AG-UI.
16
+
17
+
Middleware is the flexible option. It allows you to translate existing protocols
18
+
and applications to AG-UI events creating a bridge between your existing system
19
+
and AG-UI.
14
20
15
21
Middleware is great for:
22
+
16
23
- Taking your **existing protocol or API** and **translating it universally**
17
24
- Working within the confines of **an existing system or framework**
18
25
-**When you don't have direct control** over the agent framework or system
19
26
20
27
## What you'll build
21
28
22
29
In this guide, we'll create a middleware agent that:
30
+
23
31
1. Extends the `AbstractAgent` class
24
32
2. Connects to OpenAI's GPT-4o model
25
33
3. Translates OpenAI responses to AG-UI events
26
34
4. Runs in-process with your application
27
35
28
-
This approach gives you maximum flexibility to integrate with existing codebases while maintaining the full power of the AG-UI protocol.
36
+
This approach gives you maximum flexibility to integrate with existing codebases
37
+
while maintaining the full power of the AG-UI protocol.
29
38
30
39
Let's get started!
31
40
@@ -408,7 +417,9 @@ Did you build a custom adapter that others could reuse? We welcome community
408
417
contributions!
409
418
410
419
1. Fork the [AG-UI repository](https://github.com/ag-ui-protocol/ag-ui)
411
-
2. Add your package under `integrations/` with docs and tests
420
+
2. Add your package under `typescript-sdk/integrations/`. See
421
+
[Contributing](../development/contributing) for more details and naming
422
+
conventions.
412
423
3. Open a pull request describing your use-case and design decisions
413
424
414
425
If you have questions, need feedback, or want to validate an idea first, start a
A server implementation allows you to **emit AG-UI events directly from your agent or server**. This approach is ideal when you're building a new agent from scratch or want a dedicated service for your agent capabilities.
8
+
A server implementation allows you to **emit AG-UI events directly from your
9
+
agent or server**. This approach is ideal when you're building a new agent from
10
+
scratch or want a dedicated service for your agent capabilities.
9
11
10
12
## When to use a server implementation
11
-
Server implementations allow you to directly emit AG-UI events from your agent or server. If you are not using an
12
-
agent framework or haven't created a protocol for your agent framework yet, this is the best way to get started.
13
+
14
+
Server implementations allow you to directly emit AG-UI events from your agent
15
+
or server. If you are not using an agent framework or haven't created a protocol
16
+
for your agent framework yet, this is the best way to get started.
13
17
14
18
Server implementations are also great for:
19
+
15
20
- Building a **new agent frameworks** from scratch
16
21
-**Maximum control** over how and what events are emitted
17
22
- Exposing your agent as a **standalone API**
18
23
19
24
## What you'll build
20
25
21
26
In this guide, we'll create a standalone HTTP server that:
0 commit comments