dspyground  by Scale3-Labs

Optimize AI agent prompts with DSPy GEPA

Created 2 months ago
285 stars

Top 92.0% on SourcePulse

GitHubView on GitHub
Project Summary

DSPyground is an open-source prompt optimization harness designed to elevate AI agent prompts from basic to production-ready. It targets engineers and researchers building AI SDK agents, enabling them to iteratively sample, optimize, and align agent behavior across multiple dimensions for enhanced quality and efficiency. The primary benefit is delivering a highly optimized, portable prompt artifact directly into existing agent workflows.

How It Works

The tool employs a modified Genetic-Pareto Evolutionary Algorithm (GEPA) to refine prompts. Users import their existing AI SDK tools and prompts via a configuration file, creating a 1:1 environment. Through an interactive process, users collect "trajectory samples" of agent interactions, providing both positive and negative feedback. DSPyground then uses LLM-as-a-judge for reflection-based scoring across five key dimensions: Tone, Accuracy, Efficiency, Tool Accuracy, and Guardrails. The GEPA algorithm iteratively synthesizes this feedback to evolve a Pareto frontier of optimized prompts, ultimately yielding a refined system prompt.

Quick Start & Requirements

  • Installation: Global installation via npm install -g dspyground or pnpm add -g dspyground.
  • Prerequisites: Node.js 18+, an AI Gateway API key.
  • Setup: Initialize with npx dspyground init and start the dev server with npx dspyground dev. The application runs at http://localhost:3000.
  • Docs: Links to DSPy and AI SDK documentation are available within the project's README.

Highlighted Details

  • Multi-Dimensional Optimization: Optimizes prompts across Tone, Accuracy, Efficiency, Tool Accuracy, and Guardrails using LLM-as-a-judge.
  • Environment Portability: Seamlessly imports existing AI SDK tools and prompts via dspyground.config.ts.
  • Modified GEPA Algorithm: Extends GEPA with reflection-based scoring, dual feedback learning (positive/negative examples), and evaluation on full conversational trajectories.
  • Structured Output: Supports defining JSON schemas for data extraction, classification, and other structured output tasks.

Maintenance & Community

Developed by the team behind Langtrace AI and Zest AI. No specific community channels (e.g., Discord, Slack) are detailed in the provided README.

Licensing & Compatibility

  • License: Apache-2.0.
  • Compatibility: The Apache-2.0 license is permissive, generally allowing commercial use and integration into closed-source projects.

Limitations & Caveats

Requires an AI Gateway API key for model access. All optimization data and configurations are stored locally within the project's .dspyground/data/ directory, which should be added to .gitignore. The effectiveness of optimization is dependent on the quality and representativeness of the collected trajectory samples and the capabilities of the LLM used for reflection.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
7 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.