Skip to content

v0.6.9 – DSPy Typed Signatures, Workflow Refactor & Docs

Choose a tag to compare

@github-actions github-actions released this 07 Dec 17:55
· 158 commits to main since this release

v0.6.9 – DSPy Typed Signatures, Workflow Refactor & Docs

Highlights

Typed Pydantic Models for Structured Outputs

  • Pydantic-based output models – New typed_models.py module 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 modelsRoutingDecisionOutput, 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 constraintsassert_valid_agents(), assert_valid_tools(), assert_mode_agent_consistency() for critical validations.
  • Soft suggestionssuggest_valid_agents(), suggest_valid_tools(), suggest_mode_agent_consistency() for optimization hints.
  • Task type detectiondetect_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 signaturesTypedTaskAnalysis, 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.py into models.py for better organization.
  • Streamlined Group Chat – Introduced GroupChatBuilder in group_chat_adapter.py and 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.md with comprehensive project overview, structure, and development conventions.
  • Tracing Configuration – Added comprehensive documentation for TracingConfig capture_sensitive field 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 configurationenable_routing_cache, cache_ttl_seconds settings 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