v0.6.9 – DSPy Typed Signatures, Workflow Refactor & Docs
v0.6.9 – DSPy Typed Signatures, Workflow Refactor & Docs
Highlights
Typed Pydantic Models for Structured Outputs
- Pydantic-based output models – New
typed_models.pymodule provides validated, type-safe outputs from DSPy predictions. - Automatic coercion – Comma-separated strings automatically convert to lists; scores clamp to valid ranges.
- 8 typed output models –
RoutingDecisionOutput,TaskAnalysisOutput,QualityAssessmentOutput,ProgressEvaluationOutput,ToolPlanOutput,WorkflowStrategyOutput,HandoffDecisionOutput,CapabilityMatchOutput. - Field validators – Normalize execution modes to lowercase, validate literal values, and enforce constraints.
DSPy Assertions for Routing Validation
- Expanded assertions module – Comprehensive validation functions for routing decisions.
- Hard constraints –
assert_valid_agents(),assert_valid_tools(),assert_mode_agent_consistency()for critical validations. - Soft suggestions –
suggest_valid_agents(),suggest_valid_tools(),suggest_mode_agent_consistency()for optimization hints. - Task type detection –
detect_task_type()classifies tasks as research/coding/analysis/writing/general with keyword sets. - Routing assertions decorator –
@with_routing_assertions()for assertion-driven backtracking.
Typed Signatures for DSPy 3.x
- 7 typed signatures –
TypedTaskAnalysis,TypedTaskRouting,TypedEnhancedRouting,TypedQualityAssessment,TypedProgressEvaluation,TypedToolPlan,TypedWorkflowStrategy. - Pydantic output fields – Signatures use Pydantic models as
dspy.OutputField()types for JSON schema compliance. - DSPy 3.x compatibility – Leverages DSPy's native Pydantic support for structured outputs.
Workflow Refactor & Message Consolidation
- Consolidated Message Models – Merged message-related classes from
messages.pyintomodels.pyfor better organization. - Streamlined Group Chat – Introduced
GroupChatBuilderingroup_chat_adapter.pyand removed redundant builder files. - API Versioning – Adjusted API versioning in frontend client and tests to align with new endpoint structure.
Documentation Updates
- Project Overview – Updated
GEMINI.mdwith comprehensive project overview, structure, and development conventions. - Tracing Configuration – Added comprehensive documentation for
TracingConfigcapture_sensitivefield with security notes. - Tavily MCP Tool – Added tests and documentation for Bearer token authentication.
Performance Optimization
- Routing cache – TTL-based caching for routing decisions to avoid redundant LLM calls.
- Cache configuration –
enable_routing_cache,cache_ttl_secondssettings in workflow config. - Lazy module initialization – Typed predictors initialized on first use.
Configuration
New settings in workflow_config.yaml:
dspy:
optimization:
use_typed_signatures: true # Use Pydantic output models
enable_routing_cache: true # Cache routing decisions
cache_ttl_seconds: 300 # Cache TTL (5 minutes)Migration Notes
No breaking changes – Existing workflows continue to work.
Typed signatures enabled by default – Set use_typed_signatures: false to disable.
Routing cache enabled by default – Set enable_routing_cache: false to disable.
Field name consistency – RoutingDecisionOutput uses execution_mode (not mode).
Full Changelog
Backend Changes
New: typed_models.py with Pydantic models for all DSPy outputs.
New: assertions.py with comprehensive validation logic.
Updated: signatures.py with typed signature classes.
Updated: reasoner.py with routing cache and typed signature support.
Refactored: models.py consolidated message dataclasses.
Updated: src/agentic_fleet/tools/tavily_mcp_tool.py with Bearer token auth.
Tests
New: test_typed_models.py (44 tests).
New: test_assertions.py (39 tests).
Updated: tests/dspy_modules/test_reasoner