Mesh Agent
The mesh agent routes queries to Svantic mesh agents and knowledge bases. It sends the phase prompt to the configured mesh endpoint, receives a conversational response, and writes the transcript to the workspace.
Unlike most agents, role files are optional for mesh phases — the query can be derived entirely from upstream context. Use the mesh agent when you need to incorporate enterprise knowledge, consult specialized AI assistants, or tap into pre-built mesh conversational workflows.
Sample Phase
Section titled “Sample Phase”- name: research agent: mesh role: researcher depends_on: [fetch-context]Phase Configuration
Section titled “Phase Configuration”Phase YAML Fields
Section titled “Phase YAML Fields”| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique phase name within the workflow |
type | string | No | Defaults to "standard" |
agent | string | Yes | Must be "mesh" |
role | string | No | Optional role file — mesh can derive context from upstream handoffs alone |
depends_on | string[] | No | Upstream phases that must complete before this phase runs |
sources | SourceEntry[] | No | Optional context sources to augment the mesh query |
Source Entry Fields
Section titled “Source Entry Fields”| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Identifier for the source |
file | string | No | Workspace file to include as context |
Sources provide additional context to the mesh query beyond what the role file and upstream handoffs supply. They’re useful for grounding the conversation in specific documents or data.
Settings
Section titled “Settings”Configure under agents.mesh in settings.json (via cliq setup or cliq settings):
| Key | Required | Default | Description |
|---|---|---|---|
agents.mesh.url | Yes | — | Mesh endpoint URL |
agents.mesh.client_id | Yes | — | OAuth2 client ID for mesh authentication |
agents.mesh.client_secret | Yes | — | OAuth2 client secret for mesh authentication |
Output
Section titled “Output”Handoff Structure
Section titled “Handoff Structure”{ "data": { "session_id": "mesh-sess-a1b2c3d4", "messages": 6 }, "text": "Mesh conversation transcript written to workspace"}Field Reference
Section titled “Field Reference”| Field | Location | Description |
|---|---|---|
session_id | data.session_id | Unique identifier for the mesh conversation session |
messages | data.messages | Total number of messages exchanged in the conversation |
Files Written
Section titled “Files Written”The mesh agent writes the full conversation transcript to .cliq/files/{phase}/transcript.md. This file contains the complete question-and-answer exchange and is available to downstream phases.
Downstream Access
Section titled “Downstream Access”commands: - name: check-session run: 'echo "Mesh session $(handoff.consult.data.session_id) had $(handoff.consult.data.messages) messages"'Examples
Section titled “Examples”Example: Consult a knowledge base before implementation
Section titled “Example: Consult a knowledge base before implementation”Query an enterprise knowledge base for architectural guidance, then pass the response to an implementation phase.
phases: - name: consult-architecture agent: mesh role: architecture-advisor sources: - name: requirements file: requirements.md
- name: implement agent: cursor depends_on: [consult-architecture]Example: Context-only mesh query (no role file)
Section titled “Example: Context-only mesh query (no role file)”Derive the query entirely from upstream context — no role file needed.
phases: - name: fetch-ticket agent: jira action: get_issue sources: - name: ticket.json ref: PROJ-789
- name: consult-docs agent: mesh depends_on: [fetch-ticket]
- name: implement agent: cursor depends_on: [consult-docs]Example: Specialized mesh agent for compliance review
Section titled “Example: Specialized mesh agent for compliance review”Route a compliance question to a domain-specific mesh agent with supporting documents.
phases: - name: implement agent: cursor
- name: compliance-check agent: mesh role: compliance-reviewer depends_on: [implement] sources: - name: policy file: docs/data-policy.md - name: regulations file: docs/gdpr-summary.md
- name: review type: gate agent: hug depends_on: [compliance-check] review: reviewer: legal-team- Obtain your Svantic mesh credentials (client ID and client secret) from your mesh administrator
- Identify the mesh endpoint URL for your organization
cliq settings agents.mesh.url "https://mesh.example.com/api/v1" --globalcliq settings agents.mesh.client_id "your-client-id" --globalecho $MESH_SECRET | cliq settings agents.mesh.client_secret --stdin --globalcliq doctor agent meshValidation
Section titled “Validation”cliq doctor agent mesh checks:
agents.mesh.url,agents.mesh.client_id, andagents.mesh.client_secretare configured- Mesh endpoint is reachable
- Credentials can authenticate successfully