agent_core
Agent Core
Section titled “Agent Core”Protocol-agnostic agent domain types.
This crate defines the universal vocabulary for agent interactions — messages, content parts, task phases, and conversation context — without any dependency on A2A, MCP, or any specific wire protocol.
Design Principles
Section titled “Design Principles”- Zero protocol dependencies: only
serde+serde_json - Minimal surface: just the types every consumer needs
- Conversion-friendly: types designed for cheap
From/Intomapping - WASM-compatible: no I/O, no async, no platform-specific code
Consumers that only need to describe agent interactions (studio, coordination,
tests) depend on agent_core alone. The agent_sdk crate provides bidirectional
conversions between these types and protocol-specific types (A2A, MCP, etc.).
use agent_core::{AgentMessage, Role, ContentPart};
// Simple text message — no protocol ceremonylet msg = AgentMessage::user_text("What's the weather?");
// Structured contentlet msg = AgentMessage::new(Role::User, vec![ ContentPart::Text("Analyze this data".into()), ContentPart::Data(serde_json::json!({"rows": 42})),]);