Actions & MCP
Actions
Actions
Actions (also called Tools in the backend)
are the functions that your Agents can perform to interact with external systems and services.
They extend your agents’ capabilities beyond just the language model.Built-in Actions:
Custom Actions:
Name | Description | Requires Config | Provider Choices |
---|---|---|---|
Internal Search | Search through your organization’s indexed documents and knowledge base | Yes | Built-in with swappable components |
Web Search | Search the internet for real-time information and current events | Yes | Google, Serper, Exa, Firecrawl (optional) |
Code Interpreter | Execute Python code, analyze data, and generate visualizations | No | Built-in |
Image Generation | Create images from text descriptions using AI models | Yes | OpenAI |
SCIM support for common IdPs is coming soon!
- API Integrations: Connect to external REST APIs
- Database Operations: Query and update databases
- Workflow Automation: Trigger business processes
- File Operations: Read, write, and manipulate files
MCP
MCP
Model Context Protocol (MCP)
is an open standard that enables AI assistants to securely access external data sources and tools.
Onyx can be configured as an MCP client to interact with external systems, databases,
and APIs in a controlled manner.Key features of MCP:
- External Data Access: Connect to databases, APIs, and file systems
- Authentication: Pass through OAuth to ensure secure access to your MCP server.
(Advanced) Custom Built-in Actions
(Advanced) Custom Built-in Actions
Sometimes, you need more control over your action than what is possible with a Custom Action.
Since Onyx is open-source, you can extend the built-in actions to your liking!To find templates for built-in actions,
see
backend/onyx/tools/tool_implementations
in the Onyx repository.Agents
Agents
Agents
Agents are AI assistants with custom instructions, Actions, and data access that extend the base LLM’s capabilities.Built-in Agents:
The terms Personas, Assistants,
and Agents are used interchangeably throughout Onyx and refer to the same concept.
id: 0
Search Agent - Uses the Search Tool to answer questions from your knowledge baseid: -1
General Agent - Basic chat with no tools (basic chat with an LLM)id: -2
Paraphrase Agent - Uses Search Tool and quotes exact snippets from sourcesid: -3
Art Agent - Generates images and visual content
- Use the
GET /persona
API endpoint to list all agents - In the Admin Panel: Click into an agent and check the first number in the URL
Chat
Streamed Chat Responses
Streamed Chat Responses
The chat response system uses a packet-based architecture to deliver real-time responses to users.
Instead of waiting for a complete response,
the system breaks down the chat interaction into discrete packets that can be streamed incrementally.Every packet follows a consistent structure defined by the Streaming Flow:
Packet
class:- A chat request triggers the streaming process
- Various packet types are generated based on the required operations (reasoning, tool calls, AI response, documents, citations, etc.)
- Packets are sent with sequential indices to maintain order
- The frontend processes packets in real-time to update the UI
- An
OverallStop
packet signals completion
Basic Message Packets
Basic Message Packets
MessageStart and MessageDeltaThese packets form the core of the streaming response system:
- MessageStart: Initiates a new message with initial content and final search documents (if any)
- MessageDelta: Delivers incremental text content as it’s generated
Control Packets
Control Packets
Session and Section ManagementControl packets manage the flow and lifecycle of the streaming process:
- OverallStop: Signals the end of the entire streaming session
- SectionEnd: Marks the completion of a packet type (reasoning, message, citations, etc.)
Tool Packets
Tool Packets
Tool responses are streamed in the same way as the main message response.Search Tools
- SearchToolStart and SearchToolDelta handle document search operations
- ImageGenerationToolStart, ImageGenerationToolDelta, and ImageGenerationToolHeartbeat manage AI image creation
- CustomToolStart and CustomToolDelta are used for MCP and custom Actions
Reasoning Packets
Reasoning Packets
Any reasoning steps are streamed so the frontend can render them as the system is processing.
Reasoning packets are generally the first ones sent.
- ReasoningStart: Begins a reasoning section
- ReasoningDelta: Streams the AI’s reasoning process
Citation Packets
Citation Packets
Citation packets associate citation ids with document ids.
- CitationStart: Initiates citation results
- CitationDelta: Delivers source citations and references
Connectors
When you see the term Connector in Onyx or elsewhere in this documentation,
we’re generally referring to ConnectorCredentialPairs
Connectors
Connectors
Connectors
in Onyx define the data you would like to indexname
: Not actually displayed in the UI ifConnectorCredentialPairMetadata:name
is setsource
: Which system to connect to (seeDocumentSource
accordion below)input_type
: How theConnector
retrieves data (seeInputType
accordion below)connector_specific_config
: Source-specific settings like folder paths or channels. You will need to see/backend/onyx/connectors
for the expected Connector-specific Configurations.refresh_freq
: How often to check for new or updated content in secondsprune_freq
: How often to remove old content from Onyx in secondsindexing_start
: Optional datetime to specify when indexing should begin
Python
Credentials
Credentials
Credentials
contain the authentication details needed to access data sources. These include API keys,
OAuth tokens, personal access tokens (PATs),
or service account credentials that allow Onyx to securely connect to your external systems.Types of Credentials
:- API Keys: Simple token-based authentication
- OAuth Tokens: Delegated authorization with refresh capabilities
- Service Accounts: Machine-to-machine authentication
- Personal Access Tokens: User-specific access credentials
ConnectorCredentialPairs
ConnectorCredentialPairs
Behind the scenes,
Connectors
and Credentials
are combined into a ConnectorCredentialPair
(CC-pair).
A CC-pair is an active connection that can sync data from your external sources into Onyx.
CC-pairs are what you see and manage on the Admin Connectors
page.CC-pair functionality:- Active Connections: Live data synchronization between source and Onyx
- Status Monitoring: Track sync health and performance
- Access Control: Manage who can see data from this connection
- Configuration Management: Update sync settings and credentials
If you’re creating
Connectors
through the API, you must associate them with a Credential
(CC-pair)
to make them active!ConnectorCredentialPairMetadata
ConnectorCredentialPairMetadata
ConnectorCredentialPairMetadata
defines the configuration and access settings for a CC-pair.Configuration options:name
: Optional display name for the CC-pair (overrides theConnector
name)access_type
: Who can access data from this CC-pair (seeAccessType
accordion below)auto_sync_options
: Optional configuration for automatic synchronization settingsgroups
: List of group IDs that have access to this CC-pair
Python
Documents
DocumentBase
DocumentBase
DocumentBase
is a core structure used throughout Onyx for storing and managing document data.
Note that the embeddings are stored in Vespa separately.id
: Unique identifier. Generated by Onyx if not providedsections
: List of content sections (seeTextSection
andImageSection
)source
: The system this document originated from (seeDocumentSource
)semantic_identifier
: Displayed in the UI as the name of the Documentmetadata
: Arbitrarystring
orlist[string]
that will be saved as tags for this Documentdoc_updated_at
: UTC timestamp when the document was last updatedchunk_count
: Number of chunks the document is split into for processingprimary_owners
: Metadata about people associated with the Documentsecondary_owners
: Metadata about people associated with the Documenttitle
: Used for search (defaults tosemantic_identifier
if not specified)from_ingestion_api
: Whether this document came from the Ingestion APIadditional_info
: Connector-specific information that other parts of the code may needexternal_access
: Permission sync data (Enterprise Edition only)
The Ingestion API extends the DocumentBase definition to include
cc_pair_id
to automatically associate a
document with a CC-pair.Python
DocumentSource
DocumentSource
DocumentSource
is an enum that defines the valid sources for a document.
Uploading files to the Ingestion API and creating Connectors
programmatically require specifying a
DocumentSource
.Python
TextSection
TextSection
TextSection
is a portion of a Document in Onyx.text
: The actual text content of the sectionlink
: Optional URL that this text section relates to or was sourced from
Python
ImageSection
ImageSection
ImageSection
is an image extracted from a Document in Onyx.image_file_id
: UUID of the image file stored in Onyx’s file storetext
: Optional text description or caption for the imagelink
: Optional URL that this image section relates to or was sourced from
Python
AccessType
AccessType
AccessType
defines who can access data from a Connector
in Onyx.PUBLIC
: All Onyx users may access data from thisConnector
PRIVATE
: Only the user who created theConnector
and specified Groups may access data from thisConnector
SYNC
: OnlyConnectors
with permission-sync support can be set to SYNC. TheConnector
will sync access permissions with the source system.
Python
InputType
InputType
InputType
defines how a Connector
retrieves data from its source system.LOAD_STATE
: Single load of data from the sourcePOLL
: Continuous polling for new data from the source (starts with a full load)EVENT
: Not implemented for mostConnectors
SLIM_RETRIEVAL
: For permission-syncingConnectors
Python