Skip to content

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)

πŸ“– 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:

  1. Demonstrate - Bootstrap pipeline-aware demonstrations that guide language models
  2. Search - Provide sophisticated retrieval capabilities strategically placed in pipelines
  3. 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

  1. Implement infrastructure trait abstractions (airsdsp/infra)
  2. Implement core stage hierarchy and pipeline (airsdsp/core)
  3. Provide clean, type-safe Rust APIs
  4. Comprehensive documentation and examples

Phase 2: Patterns & Orchestration (Months 4-6) - PLANNED

Focus: High-level patterns and multi-pipeline support

  1. High-level pattern library (CoT, ReAct, Multi-hop)
  2. Multi-pipeline orchestration system
  3. Task classification and routing
  4. Extended examples and tutorials

Phase 3: Tooling (Months 7-9) - PLANNED

Focus: Developer experience and observability

  1. Evaluation framework (G-Eval priority)
  2. Debugging and observability tools
  3. Performance optimization and benchmarking
  4. Production deployment patterns

Future Research

  1. DAG-based intent decomposition (research phase)
  2. Advanced composition patterns
  3. Integration with AirsStack ecosystem
  4. 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.


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


πŸ“š 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)