Repository navigation
feat: Add experimental AG-UI supported chat endpoint and PPL query assist #1035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 15 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
8d7b376
Add experimental AG-UI supported chat endpoint and PPL query assist
kylehounslow 352a8bb
Merge branch 'robusta-dev:master' into master
kylehounslow b382b4d
update readme
kylehounslow e699901
update poetry.lock
kylehounslow a5797d7
* bugfix: Only invoke front-end query execution if tool is available
kylehounslow caef97f
nit: apply 1st round of PR review fixes
kylehounslow 48d134f
nit: apply 2nd round of PR AI review fixes
kylehounslow c961cdd
nit: more AI review fixes
kylehounslow 0e9d5e2
nit: more AI review fixes
kylehounslow 6388397
bugfix: check for correct fe_tool_name in _should_execute_suggested_q…
kylehounslow 0fcebb8
bugfix: front/back-end tool parsing bug
kylehounslow 84345e0
update opensearch_query_assist unit tests
kylehounslow e6814a1
bugfix: move page context to recent conversation history to apply rec…
kylehounslow c636726
nit: coderabbit fixes
kylehounslow db2ff1a
Add ag-ui server to Dockerfile
kylehounslow 5e2d87e
nit: better formatting for TodoWrite messages
kylehounslow f38d258
Merge branch 'master' into master
arikalon1 40427cd
chore: Add OSD setup gist link in README
kylehounslow c262635
chore: update poetry.lock
kylehounslow 6be5a61
nit: apply pre-commit lint fixes
kylehounslow 99eb744
nit: apply mypy fixes (rename ag-ui/server.py)
kylehounslow 4905aa9
nit: more mypy fixes
kylehounslow 6ec74ba
nit: more mypy fixes
kylehounslow 87ae8e5
nit: fix ruff checks
kylehounslow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # AG-UI - Experimental HolmesGPT Server | ||
|
|
||
| AG-UI is an experimental extension to HolmesGPT that demonstrates [AG-UI](https://docs.ag-ui.com/introduction) capabilities (page context and state sharing, front-end tools execution, etc) through a specialized `/api/agui/chat` endpoint and a web-based "ExampleOps✨" observability demo interface. The AG-UI compatible `server.py` is adapted from the [existing server.py implementation](../../server.py) | ||
|
|
||
| _⚠️ **Disclaimer**: AG-UI is experimental within HolmesGPT. APIs and interfaces may change as the project evolves. The demonstration server and frontend is not intended for production use._ | ||
|
|
||
|  | ||
|
|
||
| ## Known Limitations: | ||
|
|
||
| 1. Front-end tool auto-discovery and integration with LLM is not yet supported. Front-end tool discovery and execution is handled statically in the back-end. | ||
| 1. Front-end tool results are not yet supported. No-op 200 response is returned to front-end. | ||
| 1. Tested with Anthropic Claude Sonnet 3.7 and 4.0 on AWS Bedrock only. | ||
| 1. `TodoWrite` tool rendering is not properly supported. | ||
|
|
||
| ## 🛠️ Quick Start | ||
|
|
||
| ### **0. Prerequisites** | ||
|
|
||
| - **HolmesGPT** with experimental AG-UI server. | ||
| - **Data Sources**: Prometheus (`:9090`) and/or OpenSearch (`:9200`) | ||
| - Recommended to run [opentelemetry-demo](https://github.com/open-telemetry/opentelemetry-demo) via docker-compose. | ||
| - **Node.js** 20+ (for frontend demonstration) | ||
|
|
||
| ### **1. Set up datasources** | ||
|
|
||
| A simple way to generate synthetic Prometheus metrics, OpenSearch logs, traces and more, is to use: [opentelemetry-demo](https://github.com/open-telemetry/opentelemetry-demo) | ||
|
|
||
| ```bash | ||
| git clone git@github.com:open-telemetry/opentelemetry-demo.git | ||
| cd opentelemetry-demo | ||
| docker compose up -d | ||
| ``` | ||
|
|
||
| ### **2. Start HolmesGPT AG-UI Server on port 5050** | ||
|
|
||
| Assumes there is a local Prometheus server (containing metrics) at `localhost:9090` (e.g. [opentelemetry-demo](https://github.com/open-telemetry/opentelemetry-demo)) and using AWS Bedrock as LLM. See [HolmesGPT documentation](https://holmesgpt.dev/) for alternate configurations. | ||
|
|
||
| ```bash | ||
| # Start HolmesGPT AG-UI compatible server | ||
| cd holmesgpt | ||
| export HOLMES_PORT=5050 | ||
| export PROMETHEUS_URL=http://localhost:9090 | ||
| export AWS_PROFILE=default | ||
| export AWS_REGION=us-east-1 | ||
| export MODEL=bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0 | ||
| poetry run python experimental/ag-ui/server.py | ||
| ``` | ||
|
|
||
| ### **3. Run "ExampleOps✨" Demo Frontend** | ||
|
|
||
| ExampleOps✨ is a lightweight observability frontend that demonstrates AG-UI capabilities (page context, state sharing, front-end tools execution, etc). | ||
| Create .env file at `experimental/ag-ui/front-end/.env`. See example below and replace Prometheus/OpenSearch urls as needed: | ||
|
|
||
| ```env | ||
| # AG-UI Agent Configuration | ||
| HOLMES_PORT=5050 | ||
| AGENT_URL=http://localhost:${HOLMES_PORT} | ||
| # Prometheus Configuration | ||
| REACT_APP_PROMETHEUS_URL=http://localhost:9090 | ||
|
|
||
| # OpenSearch Configuration | ||
| REACT_APP_OPENSEARCH_URL=http://localhost:9200 | ||
| REACT_APP_OPENSEARCH_USER=user | ||
| REACT_APP_OPENSEARCH_PASSWORD=pass | ||
| ``` | ||
|
|
||
| ```bash | ||
| cd experimental/ag-ui/front-end | ||
| npm install && npm start | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # AG-UI Front-End Configuration | ||
| PORT=5151 | ||
| # AG-UI Agent Configuration | ||
| HOLMES_PORT=5050 | ||
| AGENT_URL=http://localhost:${HOLMES_PORT} | ||
| # Prometheus Configuration | ||
| REACT_APP_PROMETHEUS_URL=http://localhost:9090 | ||
|
|
||
| # OpenSearch Configuration | ||
| REACT_APP_OPENSEARCH_URL=http://localhost:9200 | ||
| REACT_APP_OPENSEARCH_USER=admin | ||
| REACT_APP_OPENSEARCH_PASSWORD=admin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| node_modules/ | ||
| package-lock.json | ||
| .env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # ExampleOps✨ | ||
|
|
||
| A React TypeScript demo observability application with integrated HolmesGPT AG-UI chat assistant. | ||
|
|
||
|  | ||
|
|
||
| ## Setup | ||
|
|
||
| 1. Install dependencies: | ||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| 2. Configure your agent endpoint: | ||
| ```bash | ||
| cp .env.example .env | ||
| # Edit .env to set your AGENT_URL | ||
| ``` | ||
|
|
||
| 3. Start the development server: | ||
| ```bash | ||
| npm start | ||
| ``` | ||
|
|
||
| ## Configuration | ||
|
|
||
| The app expects an AG-UI compatible agent service running at the base URL specified in `AGENT_URL`. The chat endpoint will be accessed at `${AGENT_URL}/api/agui/chat`. The agent should: | ||
|
|
||
| - Follow the AG-UI Protocol | ||
| - Accept POST requests with `RunAgentInput` payload | ||
| - Return Server-Sent Events (SSE) stream containing AG-UI events | ||
|
|
||
|
|
||
| ## AG-UI Integration | ||
|
|
||
| The chat assistant uses: | ||
|
|
||
| - **HttpAgent**: For HTTP-based agent communication | ||
| - **AgentSubscriber**: For handling streaming events | ||
| - **Event Types**: TEXT_MESSAGE_START, TEXT_MESSAGE_CONTENT, TEXT_MESSAGE_END, etc. | ||
|
|
||
| See the [AG-UI documentation](https://docs.ag-ui.com) for more details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| { | ||
| "name": "ag-ui-app", | ||
| "version": "0.1.0", | ||
| "private": true, | ||
| "dependencies": { | ||
| "@ag-ui/client": "^0.0.38", | ||
| "@ag-ui/core": "^0.0.38", | ||
| "@types/node": "^16.18.126", | ||
| "@types/react": "^18.3.24", | ||
| "@types/react-dom": "^18.3.7", | ||
| "chart.js": "^4.5.0", | ||
| "chartjs-adapter-date-fns": "^3.0.0", | ||
| "date-fns": "^2.30.0", | ||
| "react": "^18.3.1", | ||
| "react-chartjs-2": "^5.3.0", | ||
| "react-dom": "^18.3.1", | ||
| "react-markdown": "^9.0.1", | ||
| "react-scripts": "^5.0.1", | ||
| "typescript": "^4.9.5" | ||
| }, | ||
| "scripts": { | ||
| "start": "react-scripts start", | ||
| "build": "react-scripts build", | ||
| "test": "react-scripts test", | ||
| "eject": "react-scripts eject" | ||
| }, | ||
| "eslintConfig": { | ||
| "extends": [ | ||
| "react-app", | ||
| "react-app/jest" | ||
| ] | ||
| }, | ||
| "browserslist": { | ||
| "production": [ | ||
| ">0.2%", | ||
| "not dead", | ||
| "not op_mini all" | ||
| ], | ||
| "development": [ | ||
| "last 1 chrome version", | ||
| "last 1 firefox version", | ||
| "last 1 safari version" | ||
| ] | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <title>ExampleOps✨</title> | ||
| </head> | ||
| <body> | ||
| <noscript>You need to enable JavaScript to run this app.</noscript> | ||
| <div id="root"></div> | ||
| </body> | ||
| </html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.