Skip to content

Commit 3ac73b1

Browse files
ananzhashwin-pcjoshuali925kylehounslowopensearch-changeset-bot[bot]
authored
[AI] Add experimental AI Chat and Context Provider plugins for OpenSearch Dashboards (#10600)
This PR introduces two new plugins that enable AI-powered chat functionality with intelligent context capture in OpenSearch Dashboards: ### 🤖 Chat Plugin (`src/plugins/chat`) - **AI-powered chat interface** integrated into the OpenSearch Dashboards header - **AG-UI framework integration** for LLM interactions with streaming support - **Tool calling system** with dynamic action registration and execution - **Graph visualization capabilities** for time series data - **Context-aware conversations** that understand dashboard state and user interactions **Key Features:** - Real-time streaming chat responses via Server-Sent Events - Tool execution with visual feedback and result rendering - Conversation management with thread isolation - Integration with OpenSearch Dashboards navigation and theming ### 🔍 Context Provider Plugin (`src/plugins/context_provider`) - **Modern React hooks architecture** for context capture (`usePageContext`, `useDynamicContext`) - **Automatic URL state monitoring** captures time ranges, queries, datasets, and filters - **Dynamic interaction capture** tracks document expansions, text selections, and user actions - **Global context store** for AI assistant and MCP server integration - **Zero-dependency design** works across all plugins without modifications **Key Features:** - Direct browser URL monitoring for universal plugin compatibility - Category-based context organization for efficient filtering - Automatic lifecycle management with React hooks - Text selection capture with visual indicators - Backend-optimized context formatting Both plugins are designed to enhance the OpenSearch Dashboards experience by providing intelligent, context-aware AI assistance that understands user workflows and can execute actions on their behalf. --------- Signed-off-by: Anan Zhuang <[email protected]> Signed-off-by: Joshua Li <[email protected]> Co-authored-by: Ashwin P Chandran <[email protected]> Co-authored-by: Joshua Li <[email protected]> Co-authored-by: Kyle Hounslow <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
1 parent 02e0b49 commit 3ac73b1

File tree

109 files changed

+17529
-61
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+17529
-61
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ target
2020
/bwc_tmp
2121
.jruby
2222
.idea
23+
.specify
2324
*.iml
2425
*.log
2526
/test/*/failure_debug
@@ -48,6 +49,7 @@ selenium
4849
package-lock.json
4950
.yo-rc.json
5051
.vscode
52+
.kiro
5153
*.sublime-*
5254
npm-debug.log*
5355
.tern-project

.lycheeignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,15 @@ http://www.creedthoughts.gov
5656
http://not-your-opensearch-dashboards.com/
5757
my(other)?domain\.com
5858

59-
59+
# Test mock URLs that should be ignored by link checker
60+
//custom-server:
61+
//remote-server:
62+
//test-server:
63+
//other\.com/\$
64+
http://custom-server:
65+
https://remote-server:
66+
http://test-server:
67+
http://other\.com/\$
6068

6169
# External urls
6270
adobe.com

changelogs/fragments/10600.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feat:
2+
- Add experimental AI Chat and Context Provider plugins for OpenSearch Dashboards ([#10600](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/10600))

config/opensearch_dashboards.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@
388388
# set the value to false to call the label as dataset
389389
# datasetManagement.aliasedAsIndexPattern: false
390390

391-
# ===========================================
392391
# The new OpenSearch Dashboards Experience
393392
# Enable the following three flags together for the new OpenSearch Dashboards discover features
394393
# ===========================================
@@ -401,3 +400,6 @@
401400
# workspace.enabled: false
402401

403402
# explore.enabled: false
403+
404+
# Enable Chat Plugin
405+
# chat.enabled: true

docs/_sidebar.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@
3636
- [Banner](../src/plugins/banner/README.md)
3737
- [Bfetch](../src/plugins/bfetch/README.md)
3838
- [Charts](../src/plugins/charts/README.md)
39+
- [Chat](../src/plugins/chat/README.md)
3940
- console
4041
- public
4142
- application
4243
- [Hooks](../src/plugins/console/public/application/hooks/README.md)
4344
- [Content_management](../src/plugins/content_management/README.md)
45+
- [Context_provider](../src/plugins/context_provider/README.md)
4446
- [Csp_handler](../src/plugins/csp_handler/README.md)
4547
- [Dashboard](../src/plugins/dashboard/README.md)
4648
- [Data](../src/plugins/data/README.md)

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@
192192
"@aws-crypto/client-node": "^4.2.0",
193193
"@aws-crypto/sha256-js": "^5.2.0",
194194
"@aws-sdk/abort-controller": "^3.374.0",
195+
"@aws-sdk/client-bedrock-runtime": "^3.886.0",
195196
"@aws-sdk/client-sts": "^3.777.0",
196197
"@aws-sdk/credential-provider-node": "^3.777.0",
197198
"@aws-sdk/node-http-handler": "^3.374.0",
@@ -236,7 +237,6 @@
236237
"@types/ndjson": "^2.0.4",
237238
"@types/yauzl": "^2.9.1",
238239
"@xyflow/react": "^12.8.2",
239-
"JSONStream": "1.3.5",
240240
"ajv": "^8.11.0",
241241
"antlr4-c3": "^3.4.3",
242242
"antlr4ng": "^3.0.16",
@@ -274,6 +274,7 @@
274274
"json-stable-stringify": "^1.0.1",
275275
"json-stringify-safe": "5.0.1",
276276
"json5": "^2.2.3",
277+
"JSONStream": "1.3.5",
277278
"lodash": "^4.17.21",
278279
"lru-cache": "^4.1.5",
279280
"lucene": "^2.1.1",
@@ -313,7 +314,8 @@
313314
"use-sync-external-store": "^1.5.0",
314315
"uuid": "3.3.2",
315316
"whatwg-fetch": "^3.0.0",
316-
"yauzl": "^2.10.0"
317+
"yauzl": "^2.10.0",
318+
"@modelcontextprotocol/sdk": "^1.18.0"
317319
},
318320
"devDependencies": {
319321
"@babel/core": "^7.22.9",

src/.i18nrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"apmOss": "plugins/apm_oss",
55
"banner": "plugins/banner",
66
"charts": "plugins/charts",
7+
"chat": "plugins/chat",
78
"common.ui": "legacy/ui",
89
"console": "plugins/console",
910
"contentManagement": "plugins/content_management",

src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/public/overlays/sidecar/helper.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ describe('sidecar helper', () => {
4040
test('return paddingRight style object when dockedMode is right ', () => {
4141
expect(
4242
getOsdSidecarPaddingStyle({ ...props, dockedMode: SIDECAR_DOCKED_MODE.RIGHT })
43-
).toEqual({ paddingRight: 460 });
43+
).toEqual({ paddingRight: 468 }); // 460 + 8
4444
});
4545

4646
test('return paddingLeft style object when dockedMode is left ', () => {
4747
expect(
4848
getOsdSidecarPaddingStyle({ ...props, dockedMode: SIDECAR_DOCKED_MODE.LEFT })
49-
).toEqual({ paddingLeft: 460 });
49+
).toEqual({ paddingLeft: 468 }); // 460 + 8
5050
});
5151

5252
test('return null object when isHidden is true ', () => {

src/core/public/overlays/sidecar/helper.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ export const getOsdSidecarPaddingStyle = (config: ISidecarConfig | undefined) =>
2929
config?.dockedMode === SIDECAR_DOCKED_MODE.RIGHT)
3030
) {
3131
const { dockedMode, paddingSize } = config;
32+
// 8px adjustment needed for newTopNavHeader to match other elements
33+
const adjustedPaddingSize = paddingSize + 8;
3234
return {
33-
[`padding${dockedMode === SIDECAR_DOCKED_MODE.LEFT ? 'Left' : 'Right'}`]: paddingSize,
35+
[`padding${dockedMode === SIDECAR_DOCKED_MODE.LEFT ? 'Left' : 'Right'}`]: adjustedPaddingSize,
3436
};
3537
}
3638
return {};

0 commit comments

Comments
 (0)