examples/

directory
v0.83.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: MIT

README

DSPy-Go Examples

This directory contains runnable examples for the main module, agent, optimization, and tooling surfaces in DSPy-Go.

Agents
Long-Context And RLM
  • rlm - Basic live RLM run
  • rlm_context_policy - Compare full, checkpointed, and adaptive replay
  • rlm_subrlm_budgets - Deterministic sub-RLM direct/total budget demo
  • rlm_oolong - Benchmark the RLM module on OOLONG tasks
  • rlm_oolong_gepa - Optimize an adaptive RLM agent, save the optimized program, restore it, and replay it
Modules
Tools And Integrations
Research And Miscellaneous

Running Examples

From the repo root:

go run ./examples/rlm_subrlm_budgets
go run ./examples/parallel
GEMINI_API_KEY=... go run ./examples/rlm_context_policy -provider gemini
GOOGLE_API_KEY=... go run ./examples/rlm_oolong_gepa -provider gemini -artifact /tmp/oolong-program.json

Many example directories also include their own README.md with task-specific notes and flags.

Notes

  • Examples under rlm, rlm_context_policy, rlm_oolong, and rlm_oolong_gepa can make live provider calls unless explicitly scripted.
  • rlm_subrlm_budgets is deterministic and does not require an API key.
  • The others/ subtree is intentionally more experimental and lower-level than the curated examples above.

🤝 Contributing

When adding new examples:

  1. Create a dedicated directory for your example
  2. Include a README.md with clear usage instructions
  3. Add comprehensive comments explaining key concepts
  4. Include both basic and advanced usage patterns
  5. Ensure examples are self-contained and runnable

📄 License

All examples are provided under the same license as DSPy-Go. See the main repository LICENSE file for details.

Directories

Path Synopsis
Package main demonstrates basic ACE (Agentic Context Engineering) usage.
Package main demonstrates basic ACE (Agentic Context Engineering) usage.
Package main demonstrates ACE (Agentic Context Engineering) integrated with the ReAct agent.
Package main demonstrates ACE (Agentic Context Engineering) integrated with the ReAct agent.
Package main provides an interactive CLI for OAuth login to AI provider subscriptions.
Package main provides an interactive CLI for OAuth login to AI provider subscriptions.
others
gepa command
html command
mcp command
mipro command
simba command
Package main demonstrates the RLM (Recursive Language Model) module in dspy-go.
Package main demonstrates the RLM (Recursive Language Model) module in dspy-go.
Package main demonstrates the RLM module on OOLONG benchmark tasks.
Package main demonstrates the RLM module on OOLONG benchmark tasks.
xml_adapter
basic_usage command
composable command
custom_config command
predict_xml command
react_xml command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL