dspy-reasoning-modules
Use for DSPy reasoning modules including RLM, ProgramOfThought, CodeAct, Parallel, sandboxed execution, and long-context workflows.
Skill by OmidZamani
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/omidzamani-dspy-reasoning-modules
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/dspy-reasoning-modules
What's inside
- Skill name
dspy-reasoning-modules- Description
- Use for DSPy reasoning modules including RLM, ProgramOfThought, CodeAct, Parallel, sandboxed execution, and long-context workflows.
- License
- MIT
- Instructions
- 103 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Agent Skills spec issues
- allowed-tools: must be a space-separated string
Files (2)
- SKILL.md
- example.py
SKILL.md (first lines)
# DSPy Reasoning Modules
## Goal
Choose the appropriate DSPy reasoning module for long-context exploration, code-assisted reasoning, or parallel execution.
## Module Selection
| Module | Use it for | Important constraint |
|--------|------------|----------------------|
| `dspy.RLM` | Exploring very large contexts with iterative REPL code and recursive sub-LM calls | Experimental; requires Deno by default |
| `dspy.ProgramOfThought` | Solving tasks by generating and executing Python | Requires Deno by default |
| `dspy.CodeAct` | Combining generated Python with predefined tool functions | Functions only; requires Deno |
| `dspy.Parallel` | Running `(module, example)` pairs concurrently | Tune threads and error handling |
## RLM for Large Contexts
`RLM` treats long inputs as external data in a sandbox rather than placing the full context in each LM prompt.
```python
import dspy
dspy.configure(lm=dspy.LM("openai/gpt-4o"))
rlm = dspy.RLM(
"document, question -> answer",
max_iterations=12,
max_llm_calls=30,
sub_lm=dspy.LM("openai/gpt-4o-mini"),
)
result = rlm(
document=very_long_document,
question="What were the main revenue drivers?",
)
print(result.answer)
```
Use `max_iterations`, `max_llm_calls`, and `max_output_chars` as explicit cost and output bounds.
## Sandboxed Execution
The default `dspy.PythonInterpreter` uses Deno and Pyodide. It denies host filesystem, environment, and network access unless explicitly enabled.
```python
from pathlib import Path
import dspy
with dspy.PythonInterpreter(
enable_read_paths=[Path("./inputs")],
enable_network_access=["api.example.com"],
) as interpreter:
print(interpreter.execute("print('ready')"))
```
Grant only the minimum paths, environment variables, and network hosts needed by the task.
## ProgramOfThought and CodeAct
```python
import dspy
dspy.configure(lm=dspy.LM("openai/gpt-4o-mini"))
math = dspy.ProgramOfThought("question -> answer")
print(math(question="What is the sum of the first 100 integers?").answer)
```
Use `CodeAct` when generated code also needs curated host-side tools:
```python
def lookup_rate(currency: str) -> float:
"""Return a trusted exchange rate from the application service."""
return rates[currency]
agent = dspy.CodeAct("amount, currency -> converted", tools=[lookup_rate])
```
## Parallel Execution
```python
parallel = dspy.Parallel(num_threads=8, return_failed_examples=True)
results, failed_examples, exceptions = parallel(
[(program, {"question": question}) for question in questions]
)
```
## Best Practices
1. Prefer `Predict` or `ChainOfThought` until code execution or long-context exploration is justified.
2. Treat `RLM` as experimental and load-test before production deployment.
3. Bound loops and sub-LM calls.
4. Keep sandbox permissions narrow.
5. Create separate interpreters for concurrent custom-interpreter use.
## Official Documentation
- **RLM API**: https://dspy.ai/api/modules/RLM/
- **ProgramOfThought API**: https://dspy.ai/api/modules/ProgramOfThought/
- **CodeAct API**: https://dspy.ai/api/modules/CodeAct/
- **Parallel API**: https://dspy.ai/api/modules/Parallel/From OmidZamani/dspy-skills, MIT.
More from OmidZamani/dspy-skills
- 0.674score
dspy-haystack-integration
OmidZamani
Use for integrating DSPy with Haystack, optimizing Haystack prompts, improving retrieval pipelines, and extracting DSPy prompts.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-adapters-multimodal
OmidZamani
Use for DSPy adapter selection, JSONAdapter, XMLAdapter, ChatAdapter, native function calling, structured outputs, and multimodal inputs like dspy.Image or…
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-advanced-module-composition
OmidZamani
Use for composing DSPy modules with Ensemble, MultiChainComparison, ensemble voting, sequential pipelines, and multi-program workflows.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-evaluation-suite
OmidZamani
Use for evaluating DSPy programs with Evaluate, answer_exact_match, SemanticF1, custom metrics, baselines, and program comparisons.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-optimize-anything
OmidZamani
Use for GEPA optimize_anything on text artifacts such as code, prompts, agent architectures, configs, and non-DSPy optimization targets.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-optimizer-selection
OmidZamani
Use to choose or compare DSPy optimizers including LabeledFewShot, BootstrapFewShot, MIPROv2, SIMBA, GEPA, BootstrapFinetune, Ensemble, and BetterTogether.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-production-deployment
OmidZamani
Use for deploying DSPy with save/load, configure_cache, restrict_pickle, track_usage, async execution, streaming, and production runtime controls.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-rag-pipeline
OmidZamani
Use for RAG pipelines, retrieval augmented generation, ColBERTv2, context retrieval, multi-hop RAG, and grounded DSPy answers.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-signature-designer
OmidZamani
Use for DSPy signatures, InputField, OutputField, typed inputs and outputs, signature classes, and Pydantic-style structured schemas.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-simba-optimizer
OmidZamani
Use for SIMBA optimization, mini-batch introspective optimization, self-reflective rules, stochastic ascent, and numeric-metric optimization.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-custom-module-design
OmidZamani
Use for creating custom DSPy modules, extending dspy.Module, reusable components, stateful modules, serialization, and module testing.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-debugging-observability
OmidZamani
Use for debugging DSPy programs, inspect_history, tracing LLM calls, custom callbacks, observability, monitoring, and cost tracking.
SkillCFreshness: C★ 124Claude Code +9
Signals
- Stars
- 124
- Forks
- 13
- Open issues
- 1
- Last commit (this folder)
- Jun 23, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/OmidZamani/dspy-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from OmidZamani
- 0.674score
dspy-haystack-integration
OmidZamani
Use for integrating DSPy with Haystack, optimizing Haystack prompts, improving retrieval pipelines, and extracting DSPy prompts.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-advanced-module-composition
OmidZamani
Use for composing DSPy modules with Ensemble, MultiChainComparison, ensemble voting, sequential pipelines, and multi-program workflows.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-adapters-multimodal
OmidZamani
Use for DSPy adapter selection, JSONAdapter, XMLAdapter, ChatAdapter, native function calling, structured outputs, and multimodal inputs like dspy.Image or…
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-debugging-observability
OmidZamani
Use for debugging DSPy programs, inspect_history, tracing LLM calls, custom callbacks, observability, monitoring, and cost tracking.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-custom-module-design
OmidZamani
Use for creating custom DSPy modules, extending dspy.Module, reusable components, stateful modules, serialization, and module testing.
SkillCFreshness: C★ 124Claude Code +9 - 0.668score
dspy-embedding-retrieval
OmidZamani
Use for DSPy retrieval with dspy.Embedder, dspy.Embeddings, FAISS indexes, semantic search, and local or hosted embedding models.
SkillCFreshness: C★ 124Claude Code +9
Cite this page
dspy-reasoning-modules skill. Agent Mart. https://agentmart.dev/skills/omidzamani-dspy-reasoning-modules (last updated 2026-10-24)