Welcome to AirsDSP¶
Rust Implementation of the Demonstrate-Search-Predict Framework
A high-performance Rust library for building sophisticated language model and retrieval model pipelines using the foundational DSP framework principles.
π― Project Status¶
Current Phase: Architecture Complete, Phase 1 Starting
Implementation Status: Core crates under development
Timeline: 9-month phased implementation (Q1-Q3 2025)
Completed β ¶
- Comprehensive DSP framework research
- Architecture design and documentation
- ADR-001: No Automated Prompt Optimization
- ADR-002: Stage and Hook Architecture
- ADR-003: Compositional Pipeline Architecture
- Workspace ADR-001: Modular Crate Architecture
In Progress π¶
- Phase 1: Foundation (Months 1-3)
- Workspace setup
- Infrastructure trait abstractions (
airsdsp/infra) - Core execution engine (
airsdsp/core)
π Quick Links¶
π Overview¶
High-level introduction to the DSP framework and AirsDSP's design philosophy.
ποΈ Architecture¶
Detailed architecture documentation covering the 3-layer model and 6-crate structure.
πΊοΈ Roadmap¶
Development phases, milestones, and implementation timeline.
π Getting Started¶
Installation guide and your first pipeline (planned API based on finalized architecture).
π€ Contributing¶
How to contribute to development, coding standards, and project structure.
π¬ Research¶
Comprehensive DSP framework research and comparative analysis.
π¦ What is AirsDSP?¶
AirsDSP is a Rust implementation of the Demonstrate-Search-Predict (DSP) framework, originally introduced by Stanford's NLP research team. It enables developers to compose Language Models (LM) and Retrieval Models (RM) in sophisticated, multi-stage pipelines that go beyond simple retrieve-then-read approaches.
Core Concept: Stage-Based Pipelines¶
The framework is built around three fundamental stages:
- Demonstrate - Bootstrap pipeline-aware demonstrations that guide language models
- Search - Provide sophisticated retrieval capabilities strategically placed in pipelines
- Predict - Generate grounded predictions using demonstrations and retrieved context
Key Innovation: Stages are composable building blocks. Combine them in arbitrary sequences to create sophisticated reasoning pipelines with explicit control.
β¨ Design Philosophy¶
Explicit Control¶
Maintain full visibility and control over pipeline behavior without automated optimization or compilation steps.
Stage-Based Architecture¶
Flexible trait-based abstraction with specialized traits (DemonstrateStage, SearchStage, PredictStage) providing type safety.
Modular Crate Organization¶
6 independent crates organized in 3 architectural layers for clear separation of concerns and flexible dependencies.
Type Safety¶
Leverage Rust's type system for compile-time guarantees and zero-cost abstractions.
Architecture-Driven Accuracy¶
Achieve strong performance through sophisticated pipeline architecture rather than automated prompt optimization.
Production Focused¶
Designed for reliability and predictable behavior in production environments.
ποΈ Architecture Overview¶
The 3-Layer Model¶
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Layer 3: Orchestration β
β Multi-pipeline system, task classification, β
β intelligent routing β
β Crate: airsdsp/orchestration β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Layer 2: Core + Patterns + Tooling β
β βββββββββββββββββββββββββββββββββββββββββββββββ β
β 2A: Core execution (airsdsp/core) β
β 2B: Pattern library (airsdsp/patterns) β
β 2C: Tooling (airsdsp/eval, airsdsp/debug) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Layer 1: Infrastructure β
β Trait abstractions (no implementations) β
β Crate: airsdsp/infra β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
6 Modular Crates¶
Layer 1: Infrastructure
- airsdsp/infra: Trait abstractions (LanguageModel, VectorStore, Cache)
Layer 2: Core + Patterns + Tooling
- airsdsp/core: Stage hierarchy, Pipeline, Context, Hooks
- airsdsp/patterns: CoT, ReAct, Multi-hop patterns
- airsdsp/eval: G-Eval and evaluation framework
- airsdsp/debug: Tracing and observability
Layer 3: Orchestration
- airsdsp/orchestration: Multi-pipeline system, routing
See Architecture Documentation for detailed design.
π Expected Performance¶
Based on the original DSP research paper, pipelines built with this framework can achieve:
- 37-120% relative improvement over vanilla language models
- 8-40% improvement over simple retrieve-then-read baselines
- Comparable accuracy to fine-tuned models without requiring training
These gains come from architectural sophistication rather than model optimization.
π― Project Goals¶
Phase 1: Foundation (Months 1-3) - CURRENT¶
Focus: Core execution capability
- Implement infrastructure trait abstractions (
airsdsp/infra) - Implement core stage hierarchy and pipeline (
airsdsp/core) - Provide clean, type-safe Rust APIs
- Comprehensive documentation and examples
Phase 2: Patterns & Orchestration (Months 4-6) - PLANNED¶
Focus: High-level patterns and multi-pipeline support
- High-level pattern library (CoT, ReAct, Multi-hop)
- Multi-pipeline orchestration system
- Task classification and routing
- Extended examples and tutorials
Phase 3: Tooling (Months 7-9) - PLANNED¶
Focus: Developer experience and observability
- Evaluation framework (G-Eval priority)
- Debugging and observability tools
- Performance optimization and benchmarking
- Production deployment patterns
Future Research¶
- DAG-based intent decomposition (research phase)
- Advanced composition patterns
- Integration with AirsStack ecosystem
- Community-contributed patterns and metrics
See Roadmap for detailed timeline.
π¬ Research Foundation¶
AirsDSP is based on the paper:
"Demonstrate-Search-Predict: Composing retrieval and language models for knowledge-intensive NLP"
Omar Khattab, Keshav Santhanam, Xiang Lisa Li, David Hall, Percy Liang, Christopher Potts, Matei Zaharia
arXiv:2212.14024
Key Research Insights: - DSP achieved 37-120% gains vs. vanilla LMs, 8-39% vs. retrieve-then-read - Three-operation paradigm (Demonstrate-Search-Predict) is foundational - Pipeline-aware demonstrations enable multi-hop reasoning - Natural language interface between LM and RM enables composition - Manual optimization through architecture is DSP's strength
See Research Section for comprehensive analysis (18 research documents).
π AirsDSP vs DSPy¶
| Feature | AirsDSP (Planned) | DSPy |
|---|---|---|
| Control | Explicit, deterministic | Automated optimization |
| Approach | Architecture-driven accuracy | Compiler-driven optimization |
| Philosophy | Rust predictability | Python flexibility |
| Performance | Production-focused | Research-focused |
| Best For | Production systems | Research and prototyping |
| Implementation | DSP foundation | DSPy evolution |
Key Differentiation: AirsDSP implements the foundational DSP architecture (three-operation paradigm with explicit control), not the DSPy evolution (automated compilation and metric-driven optimization).
See Research: DSP vs DSPy Comparative Evolution for detailed comparison.
πΊοΈ Current Status¶
Phase: Architecture Complete, Phase 1 Starting
Timeline: Q1-Q3 2025 (9 months)
Next Milestone: Phase 1 Milestone 1.1 (Workspace Setup)
Phase Progress¶
Month 1-3 Month 4-6 Month 7-9 Post-9
| | | |
|<-- Phase 1 --> |<-- Phase 2 --> |<-- Phase 3 --> |
| Foundation | Patterns & | Tooling | 1.0 Release
| | Orchestration | | + Future
[ββββββββββββ] [ββββββββββββ] [ββββββββββββ]
In Progress Planned Planned
Recent Updates¶
- β 2025-12-16: Architecture finalized and documented
- β 2025-12-16: Workspace ADR-001 (Modular Crate Architecture) approved
- β 2025-12-16: Memory bank restructured into 6 implementation sub-projects
- β 2025-12-16: Public documentation updated to reflect finalized architecture
- π 2025-12-16: Phase 1 starting - Workspace setup in progress
See Roadmap for detailed development plan.
π Related Projects¶
AirsStack Ecosystem¶
- AirsSys - System programming components
- Actor runtime for concurrent pipelines
-
OS abstraction layer
-
AirsProtocols - Communication protocols
- MCP integration for tool providers
- LLM API clients (coming soon)
π License¶
Dual licensed under: - Apache License, Version 2.0 (LICENSE-APACHE) - MIT License (LICENSE-MIT)
π€ Contributing¶
We welcome contributions! Current priorities:
Phase 1 (Current): - Infrastructure trait implementations (mock providers) - Stage implementations (Demonstrate, Search, Predict) - Hook implementations (logging, metrics, caching) - Testing infrastructure - Documentation and examples
See Contributing Guide for details.
π¬ Stay Updated¶
- GitHub: github.com/airsstack/airsdsp
- Issues: Report issues or ideas
- Discussions: Join discussions
- Watch: Subscribe to repository for updates
π Documentation Guide¶
For New Users: 1. Start with Overview to understand DSP concepts 2. Read Architecture to understand the design 3. Check Getting Started for API examples 4. Review Roadmap to see when features will be available
For Contributors: 1. Read Contributing Guide for development setup 2. Check Roadmap for current priorities 3. Review Architecture for implementation details 4. Explore the research documentation in the Research Section
For Researchers: 1. Explore Research Section for DSP framework analysis 2. Review Comparative Analysis 3. See Product Differentiation
π Learning Resources¶
DSP Concepts: - DSP Framework Core - DSP Paper Analysis - DSP Execution Flows
Built with π¦ Rust | Powered by DSP Research | Part of the AirsStack Ecosystem
Last Updated: 2025-12-16
Current Phase: Phase 1 - Foundation
Next Release: v0.1.0 (Phase 1 complete, Month 3)