T1: Core Architecture Specification
Source: T1_ Core Architecture Specification.pdf
Status: π§ Extraction in Progress
Roadmap: Technical Architecture Roadmap
Overviewβ
The Core Architecture Specification defines the foundation systems and patterns for the composable intelligence infrastructure. This document provides detailed technical specifications for building the core platform.
Architecture Principlesβ
Modularityβ
- Systems designed as composable modules
- Clear separation of concerns
- Independent module lifecycle
- Standardized interfaces
Extensibilityβ
- Plugin architecture for custom components
- Hook system for behavior injection
- Extension system for component distribution
- API-first design
Performanceβ
- Low-latency orchestration (<100ms overhead)
- Concurrent execution support
- Efficient resource utilization
- Scalable architecture
Reliabilityβ
- Fault-tolerant design
- Automatic recovery mechanisms
- Health monitoring
- Graceful degradation
Core Componentsβ
1. Agent Orchestration Engineβ
Responsibilitiesβ
- Multi-agent task coordination
- Intelligent agent selection
- Workflow execution
- Result synthesis
Architectureβ
βββββββββββββββββββββββββββββββββββββββ
β Orchestration Engine β
βββββββββββββββββββββββββββββββββββββββ€
β - Task Analyzer β
β - Agent Selector β
β - Workflow Executor β
β - Result Synthesizer β
βββββββββββββββββββββββββββββββββββββββ
Key Interfacesβ
Task Analysis
pub trait TaskAnalyzer {
fn analyze(&self, task: &Task) -> Result<TaskAnalysis>;
}
pub struct TaskAnalysis {
pub complexity: Complexity,
pub required_capabilities: Vec<Capability>,
pub estimated_duration: Duration,
pub dependencies: Vec<TaskId>,
}
Agent Selection
pub trait AgentSelector {
fn select_agents(&self, analysis: &TaskAnalysis) -> Result<Vec<AgentId>>;
fn rank_agents(&self, agents: &[AgentId], context: &Context) -> Vec<RankedAgent>;
}
Workflow Execution
pub trait WorkflowExecutor {
fn execute(&self, workflow: &Workflow) -> Result<WorkflowResult>;
fn execute_parallel(&self, tasks: &[Task]) -> Result<Vec<TaskResult>>;
}
2. Policy Engineβ
Responsibilitiesβ
- Tool execution control
- Context-aware policy application
- Approval workflow management
- Security enforcement
Policy Rule Structureβ
[[rules]]
name = "rule-name"
priority = "admin" # admin | user | default
action = "allow" # allow | deny | ask_user
tool_pattern = "read_*"
arg_pattern = "*.md"
context = { workspace = "specific-workspace" }
Policy Evaluationβ
pub struct PolicyEngine {
rules: Vec<PolicyRule>,
approval_mode: ApprovalMode,
}
pub enum ApprovalMode {
Yolo, // Automatic approval
AutoEdit, // Auto-approve with edit capability
Ask, // Require user approval
}
impl PolicyEngine {
pub fn evaluate(&self, request: &ToolRequest) -> PolicyDecision {
// Rule matching and evaluation logic
}
}
3. Extension Systemβ
Component Typesβ
- Prompts: Agent prompt templates
- MCP Servers: Model Context Protocol integrations
- Commands: Custom CLI commands
- Hooks: Native/WASM behavior modules
Extension Manifestβ
{
"name": "extension-name",
"version": "1.0.0",
"description": "Extension description",
"author": "Author Name",
"components": {
"prompts": ["prompts/**/*.md"],
"mcp_servers": ["mcp/*.json"],
"commands": ["commands/*.toml"],
"hooks": ["hooks/*.toml"]
},
"dependencies": ["other-extension@^1.0.0"],
"metadata": {
"tags": ["category"],
"compatibility": {
"radium": ">=1.0.0"
}
}
}
Extension Lifecycleβ
- Discovery: Scan extension directories
- Validation: Verify manifest and components
- Installation: Copy to extension directory
- Registration: Register with core system
- Activation: Make available for use
4. Model Abstraction Layerβ
Engine Interfaceβ
pub trait Engine {
async fn chat(&self, request: ChatRequest) -> Result<ChatResponse>;
async fn stream_chat(&self, request: ChatRequest) -> Result<Stream<ChatChunk>>;
fn supports_reasoning(&self) -> bool;
fn get_models(&self) -> Vec<ModelInfo>;
}
pub struct ChatRequest {
pub messages: Vec<Message>,
pub model: String,
pub temperature: Option<f64>,
pub max_tokens: Option<u32>,
pub tools: Option<Vec<Tool>>,
}
pub struct ChatResponse {
pub content: String,
pub usage: TokenUsage,
pub finish_reason: FinishReason,
}
Supported Providersβ
- Gemini: Google AI models
- Claude: Anthropic models
- OpenAI: GPT models
- Self-Hosted: Ollama, vLLM, LocalAI
5. Component Architecture (Foundation)β
Component Interfaceβ
pub trait Component {
fn id(&self) -> &ComponentId;
fn version(&self) -> &Version;
fn metadata(&self) -> &ComponentMetadata;
fn validate(&self) -> Result<ValidationResult>;
fn execute(&self, input: ComponentInput) -> Result<ComponentOutput>;
}
pub struct ComponentMetadata {
pub name: String,
pub description: String,
pub author: String,
pub tags: Vec<String>,
pub dependencies: Vec<ComponentDependency>,
pub interfaces: Vec<Interface>,
}
Component Lifecycleβ
- Creation: Define component interface and implementation
- Validation: Verify component meets standards
- Registration: Register in component registry
- Discovery: Make discoverable via component graph
- Composition: Use in composed systems
- Evolution: Update and version management
Service Architectureβ
Service Discoveryβ
pub trait ServiceRegistry {
fn register(&self, service: ServiceDescriptor) -> Result<ServiceId>;
fn discover(&self, criteria: ServiceCriteria) -> Vec<ServiceDescriptor>;
fn health_check(&self, service_id: &ServiceId) -> Result<HealthStatus>;
}
Inter-Service Communicationβ
- gRPC: Primary communication protocol
- Message Queue: Async message passing
- Event Bus: Event-driven communication
- REST API: HTTP-based APIs
State Managementβ
pub trait StateStore {
fn get<T: DeserializeOwned>(&self, key: &str) -> Result<Option<T>>;
fn set<T: Serialize>(&self, key: &str, value: &T) -> Result<()>;
fn delete(&self, key: &str) -> Result<()>;
}
Event Systemβ
pub trait EventBus {
fn publish(&self, event: Event) -> Result<()>;
fn subscribe(&self, filter: EventFilter, handler: EventHandler) -> SubscriptionId;
fn unsubscribe(&self, subscription_id: SubscriptionId) -> Result<()>;
}
pub struct Event {
pub event_type: String,
pub source: String,
pub payload: serde_json::Value,
pub timestamp: DateTime<Utc>,
}
Data Modelsβ
Agent Configurationβ
pub struct AgentConfig {
pub id: String,
pub name: String,
pub description: String,
pub prompt_path: PathBuf,
pub engine: EngineType,
pub model: String,
pub persona: Option<PersonaConfig>,
pub tools: Vec<ToolConfig>,
}
Workspace Structureβ
.radium/
βββ config.toml # Workspace configuration
βββ policy.toml # Policy rules
βββ agents/ # Agent configurations
β βββ category/
β βββ agent.toml
βββ extensions/ # Installed extensions
β βββ extension-name/
βββ plan/ # Plan execution data
β βββ REQ-XXX/
β βββ plan.json
β βββ memory/
βββ _internals/ # Internal state
βββ artifacts/
βββ memory/
βββ logs/
Performance Requirementsβ
Latency Targetsβ
- Orchestration overhead: <100ms
- Agent selection: <50ms
- Component lookup: <10ms
- Policy evaluation: <5ms
Throughput Targetsβ
- Concurrent agents: 100+
- Requests per second: 1000+
- Component operations: 10,000+/sec
Resource Limitsβ
- Memory per agent: <100MB
- CPU per agent: <1 core
- Network bandwidth: Adaptive
Security Architectureβ
Authenticationβ
- API key management
- OAuth integration
- Token-based authentication
Authorizationβ
- Role-based access control (RBAC)
- Policy-based authorization
- Context-aware permissions
Data Protectionβ
- Encryption at rest
- Encryption in transit
- Secure credential storage
Error Handlingβ
Error Typesβ
pub enum CoreError {
AgentNotFound(AgentId),
PolicyDenied(ToolRequest),
ComponentValidationFailed(ValidationError),
ServiceUnavailable(ServiceId),
Timeout(Duration),
NetworkError(NetworkError),
}
Recovery Strategiesβ
- Automatic retry with exponential backoff
- Fallback to alternative agents
- Graceful degradation
- Circuit breaker pattern
Implementation Statusβ
β Completedβ
- Multi-agent orchestration engine
- Policy engine and security framework
- Extension system
- Model abstraction layer
π§ In Progressβ
- Component interface definitions
- Component lifecycle management
- Service discovery and registration
π Plannedβ
- Component validation framework
- Component composition engine
- Inter-service communication protocols
- State management and persistence
- Event system and messaging
Related Documentationβ
- Technical Architecture Roadmap
- Agent System Architecture
- Extension System Architecture
- Architecture Overview
Note: This specification is extracted from the OpenKor T1 document. Some details may need manual review and enhancement from the source PDF.