Skip to main content

Context Management

The Copilot employs a sophisticated context understanding system that prioritizes and processes multiple information sources simultaneously.

This hierarchical approach ensures that the most relevant and specific data takes precedence when generating responses, while still maintaining awareness of broader workspace context and conversation history.

Priority

The agent prioritizes context in the following order:

PriorityContext TypeDescription
1ExplicitWidgets, skills, or MCP tools mentioned explicitly.
2SkillSkills added under AI Library.
3MCP toolActive MCP tools connected to the Copilot.
4Attached filesFiles uploaded directly to the Copilot.
5DashboardAll widgets currently on your dashboard (in all tabs).
6ConversationThe history of your current conversation.
7GlobalAll widgets available within the OpenBB Workspace, if Global Data is enabled.
8Web searchRetrieve information from the web, if Web Search is enabled.

Context Types

Explicit Context

Explicit context represents the highest priority information source, allowing you to precisely direct the Copilot's attention to specific datasets. This mechanism is particularly powerful for ensuring accuracy when working with multiple similar datasets or when you need analysis focused on a specific dataset.

When you add any of the following explicit context types (widgets, skills, or MCP tools), Copilot prioritizes them above all other available information. After sending the prompt, the context remains active.

1. Skills

When tagging a skill with the syntax /skill:skill-name, you are adding it explicitly to context.

Explicit context

2. MCP Tools

Similar to skills, MCP tools can be added to context using the / command. This displays a list of all available tools, allowing you to select exactly which one to trigger.

Explicit context

3. Widgets

Click the "Add to context" button on any widget to create a direct reference that Copilot prioritizes. Alternatively, use the "@" symbol followed by a widget name for a quick tag reference. Once the prompt is sent, the widget is removed from context.

Explicit context with @

Skills

Skills added under AI Library are prioritized next. Skills are reusable instruction sets that extend what the OpenBB Copilot can do. This is particularly useful when you want to create custom workflows. Even if you don't explicitly tag a skill, the Copilot will try to match one of the available skills to your request when relevant.

Skills overview

To see all available skills, navigate to the "Skills" tab under AI Library. An example skill called openbb-html-report is included by default. To add your own custom skill, see the Skills page.

MCP Tools

Active MCP tools connected to OpenBB Workspace are the next priority level. For more details, see the MCP tools documentation here.

Depending on your use case, MCP tools offer a powerful way to connect to third-party data providers or specialized financial tools using a standardized protocol. This eliminates the need for custom development inside OpenBB Workspace.

To use MCP tools, first configure your servers (see MCP Tools configuration), then select the desired tools.

MCP tools

When enabled, Copilot gains access to all active MCP tools. You can also explicitly call a specific MCP tool to guarantee it’s invoked.

MCP tools

Attached Files

The attachment system enables the Copilot to process documents and datasets that aren't part of your current workspace widgets. Supported file types include PDF, Excel, CSV, and various other document formats.

The Copilot automatically extracts and indexes content from attached files, making them searchable and referenceable throughout your conversation. This capability is essential for performing ad-hoc analysis or incorporating external datasets and documents into your workflow.

Please note that for PDF files, text must be selectable as Optical Character Recognition (OCR) is not supported. However, you can integrate your own agent that performs OCR.

Attached files

Dashboard Context

The dashboard context provides the Copilot with comprehensive awareness of your currently active dashboard. All widgets on your active dashboard become automatically available as data sources, allowing the Copilot to understand the broader context of your work session. It also has access to each widget's metadata and the currently selected parameters.

Dashboard context

Conversation History

Conversational context enables natural, iterative analysis by maintaining awareness of your entire dialogue history within the current session.

The Copilot tracks your explicit questions and its responses. This memory allows for follow-up queries, refinement of analysis parameters, and building upon previous insights without needing to re-establish context.

The Copilot understands references to "the previous chart", "that analysis", or "the data we discussed" and can seamlessly continue complex analytical workflows across multiple conversation turns.

Conversation history

Global Data (ON/OFF flag)

The Global Data provides the Copilot with access to the entire OpenBB Workspace widget library, extending far beyond your current dashboard widgets.

When your current dashboard doesn't contain the specific data or analysis tool needed to answer a query, the Copilot can automatically identify and utilize the appropriate widgets from the entire widget library, effectively expanding your analytical capabilities on-demand without manual widget selection.

This is only possible due to the metadata associated with each widget and is why it's important to invest time in specifying the metadata carefully.

Global retrieval

Web Search (ON/OFF flag)

Web search

The web search capability enables the Copilot to access real-time information from across the internet when:

  • The available workspace data is insufficient to fully answer your query.
  • You ask to look for information on the web.

This feature automatically activates as a fallback mechanism, ensuring comprehensive responses even when dealing with breaking news, recent market developments, or information not available in your current workspace widgets.

Web search