Skip to main content

A2A Domain API

Explicit agent-to-agent messages use scoped sender/recipient and conversation contracts. Registered metadata or a caller agent ID does not execute a published Agent version or authorize another scope. Ordinary runtime tool/model execution remains in Convex.

Usage boundary​

Access the namespace on an explicitly configured root Cortex client. Host JWT and deployment-operator transports are distinct; validate current resource scope and do not infer authority from AuthContext metadata. See administrative operations.

Explicit agent-to-agent records​

send requires from/to agent IDs and a nonempty message. Importance defaults to 60 (0–100); conversation tracking defaults to true. Optional user/context/priority/tags metadata describes provenance. It returns A2AMessage with IDs and storage references. request adds a request/response contract and timeout, default 30 seconds. Without configured response/pub-sub infrastructure it can raise A2ATimeoutError after the message was stored; inspect the error's message identity and do not create a duplicate request to recover its response. broadcast records per-recipient results; storage does not certify delivery confirmation without that infrastructure. Conversation queries return the selected A2A records.

import type { Cortex } from '@cortexmemory/sdk';

export async function sendApprovedAgentRecord(cortex: Cortex) {
return cortex.a2a.send({ from: 'dispatch-agent', to: 'routing-agent',
message: 'The delivery window changed to Wednesday.', importance: 70,
metadata: { priority: 'normal', tags: ['delivery'] } });
}

This namespace is an advanced explicit operator communication/record surface. Its local orchestration is not a second ordinary app Agent runtime and does not mint grants for other agents/spaces. Runtime tool/context registries, approved Gateway actions and model policy remain the default for application orchestration. Invalid participants/message/importance are rejected; missing downstream records or failed delivery should be handled according to the returned operation rather than assuming a broadcast is atomic across recipients.

The retained autoEmbed/autoSummarize flags do not provision a hosted embedding or summarization service. Current explicit processing uses supported configured/local callbacks; runtime processing uses backend policy.

Parameter and result contracts​

These are reference definitions for the explicit server APIs. Optional fields use ?; timestamps are milliseconds since epoch unless an operation accepts a Date. Resource identifiers and participant metadata do not grant runtime authority.

A2ASendParams​

export interface A2ASendParams {
from: string;
to: string;
message: string;
userId?: string;
contextId?: string;
importance?: number;
trackConversation?: boolean;
autoEmbed?: boolean;
metadata?: {
tags?: string[];
priority?: "low" | "normal" | "high" | "urgent";
[key: string]: unknown;
};
}
FieldMeaning and defaults
fromSender agent ID
toReceiver agent ID
messageMessage content
userIdOptional user ID (enables GDPR cascade)
contextIdOptional context/workflow ID
importanceImportance level 0-100 (default: 60)
trackConversationStore in ACID conversation (default: true)
autoEmbedRetained compatibility field; does not enable a cloud embedding service.
metadataOptional metadata

A2AMessage​

export interface A2AMessage {
messageId: string;
sentAt: number;
conversationId?: string;
acidMessageId?: string;
senderMemoryId: string;
receiverMemoryId: string;
}
FieldMeaning and defaults
messageIdUnique message ID
sentAtTimestamp when sent
conversationIdACID conversation ID (if trackConversation=true)
acidMessageIdMessage ID in ACID conversation
senderMemoryIdMemory ID in sender's storage
receiverMemoryIdMemory ID in receiver's storage

A2ARequestParams​

export interface A2ARequestParams {
from: string;
to: string;
message: string;
timeout?: number;
retries?: number;
userId?: string;
contextId?: string;
importance?: number;
}
FieldMeaning and defaults
fromSender agent ID
toReceiver agent ID
messageRequest message
timeoutTimeout in milliseconds (default: 30000)
retriesNumber of retry attempts (default: 1)
userIdOptional user ID (enables GDPR cascade)
contextIdOptional context/workflow ID
importanceImportance level 0-100

A2AResponse​

export interface A2AResponse {
response: string;
messageId: string;
responseMessageId: string;
respondedAt: number;
responseTime: number;
}
FieldMeaning and defaults
responseResponse message content
messageIdOriginal request message ID
responseMessageIdResponse message ID
respondedAtTimestamp when responded
responseTimeResponse time in milliseconds

A2ABroadcastParams​

export interface A2ABroadcastParams {
from: string;
to: string[];
message: string;
userId?: string;
contextId?: string;
importance?: number;
trackConversation?: boolean;
metadata?: {
tags?: string[];
[key: string]: unknown;
};
}
FieldMeaning and defaults
fromSender agent ID
toArray of recipient agent IDs
messageMessage content
userIdOptional user ID (enables GDPR cascade)
contextIdOptional context/workflow ID
importanceImportance level 0-100 (default: 60)
trackConversationStore in ACID conversation (default: true)
metadataOptional metadata

A2ABroadcastResult​

export interface A2ABroadcastResult {
messageId: string;
sentAt: number;
recipients: string[];
senderMemoryIds: string[];
receiverMemoryIds: string[];
memoriesCreated: number;
conversationIds?: string[];
}
FieldMeaning and defaults
messageIdBroadcast message ID
sentAtTimestamp when sent
recipientsArray of recipient agent IDs
senderMemoryIdsMemory IDs in sender's storage (one per recipient)
receiverMemoryIdsMemory IDs in receivers' storage (one per recipient)
memoriesCreatedTotal memories created (sender + receiver for each)
conversationIdsConversation IDs (if trackConversation=true)

A2AConversationFilters​

export interface A2AConversationFilters {
since?: Date;
until?: Date;
minImportance?: number;
tags?: string[];
userId?: string;
limit?: number;
offset?: number;
format?: "chronological";
}
FieldMeaning and defaults
sinceFilter by start date
untilFilter by end date
minImportanceMinimum importance filter (0-100)
tagsFilter by tags
userIdFilter A2A about specific user
limitMaximum messages to return (default: 100)
offsetPagination offset
formatOutput format

A2AConversation​

export interface A2AConversation {
participants: [string, string];
conversationId?: string;
messageCount: number;
messages: A2AConversationMessage[];
period: {
start: number;
end: number;
};
tags?: string[];
canRetrieveFullHistory: boolean;
}
FieldMeaning and defaults
participantsThe two participants
conversationIdACID conversation ID (if exists)
messageCountTotal message count (before pagination)
messagesConversation messages
periodTime period covered
tagsTags found in messages
canRetrieveFullHistoryTrue if ACID conversation exists for full history

Public methods​

The following signatures describe the TypeScript namespace. Parameter and result fields are defined on this page; the installed @cortexmemory/sdk declarations also provide their compile-time types. Signatures are reference notation, not application code to execute.

send​

Send a message from one agent to another.

cortex.a2a.send(params: A2ASendParams): Promise<A2AMessage>

request​

Send a request and wait for response (synchronous request-response).

cortex.a2a.request(params: A2ARequestParams): Promise<A2AResponse>

broadcast​

Broadcast a message to multiple agents.

cortex.a2a.broadcast(params: A2ABroadcastParams): Promise<A2ABroadcastResult>

getConversation​

Get conversation between two agents with filtering.

cortex.a2a.getConversation(agent1: string, agent2: string, filters?: A2AConversationFilters): Promise<A2AConversation>

Errors and lifecycle​

Validation, missing capability, authorization, stale version and partial/unknown committed outcomes are explicit. Inspect operation/write/deletion receipts before recovery; do not repeat an external effect under a new identity after uncertainty. Close owned clients and graph resources at the end of the server workflow.

See runtime client for ordinary app execution and error handling for recovery boundaries.