lark-wiki
Manage Lark Wiki spaces, members, nodes, and document organization hierarchies.
dspy-rlm-module
Use dspy.RLM (Recursive Language Model) for reasoning over contexts too large to fit in an LLM's working window — entire codebases, long logs, massive documents, or multi-step data exploration that needs a sandboxed Python REPL. Use when the input is >100k tokens, needs recursive chunking, or benefits from the LLM writing and running code to probe data.
Full skill instructions
dspy.RLM — Recursive Language Modeldspy.RLM runs the LLM in a sandboxed Python REPL (Pyodide/WASM via Deno) with access to the full context as variables. The LLM writes code to slice, grep, summarize, and recursively sub-query the data, iterating until it can answer. Use it when the context is too large to cram into a single prompt.
PythonInterpreter): brew install deno or see https://deno.land. The interpreter is a Pyodide-in-WASM sandbox spawned by Deno.dspy.settings.lm.import dspy
dspy.configure(lm=dspy.LM("openai/gpt-4o"))
sub_lm = dspy.LM("openai/gpt-4o-mini") # cheap inner model
rlm = dspy.RLM(
"context, query -> answer",
max_iterations=20,
max_llm_calls=50,
max_output_chars=10_000,
sub_lm=sub_lm,
tools=[],
verbose=False,
)
result = rlm(
context=open("huge_log.txt").read(), # can be 500k+ tokens
query="Summarize every unique error class and how many times each appeared.",
)
print(result.answer)
dspy.RLM(
signature: type[Signature] | str,
max_iterations: int = 20, # REPL loop cap
max_llm_calls: int = 50, # sub-LM call cap (stops runaway recursion)
max_output_chars: int = 10_000, # truncate REPL stdout per step
verbose: bool = False, # print the REPL trace
tools: list[Callable] | None = None,
sub_lm: dspy.LM | None = None,
interpreter: CodeInterpreter | None = None, # custom sandbox
)
| Situation | Use |
|---|---|
| Context <100k, answer fits one LM call | dspy.Predict / dspy.ChainOfThought |
| Need external tools (web, db) | dspy.ReAct(tools=[...]) |
| Math/code that must run | dspy.ProgramOfThought |
| Huge context, recursive chunking, or data-exploration loop | dspy.RLM |
| Entire-codebase reasoning where the LM should grep/read files | dspy.RLM with file-reading tools=[...] |
Wrap the RLM in your own dspy.Module and optimize the enclosing program with GEPA. GEPA can tune both the RLM's outer signature instruction and the surrounding predictors.
class RepoAuditor(dspy.Module):
def __init__(self):
super().__init__()
self.explore = dspy.RLM("repo_tree, question -> findings",
max_iterations=30, sub_lm=dspy.LM("openai/gpt-4o-mini"))
self.synth = dspy.ChainOfThought("findings, question -> report")
def forward(self, repo_tree, question):
f = self.explore(repo_tree=repo_tree, question=question).findings
return self.synth(findings=f, question=question)
Then: dspy.GEPA(metric=..., ...).compile(student=RepoAuditor(), trainset=..., valset=...).
max_llm_calls tight (20–50) in production; raise for research.max_output_chars now defaults to 10_000; raise it deliberately if your REPL tools print large tables or document slices.sub_lm. The outer LM orchestrates; inner calls (summarize, filter, score) don't need the flagship model.rlm(context=huge_string, query="...") lets the REPL treat context as a Python variable. Avoid concatenating it into the prompt.verbose=True while debugging. Prints every REPL step — invaluable when the RLM appears to hang or loop.tools=[...]; they are exposed inside the sandbox. Useful for read_file, grep, vector_search, etc. In DSPy 3.2.x they are invoked by keyword, so give them named, typed parameters rather than positional-only signatures.which deno before reporting bugs.The default interpreter is a Deno-sandboxed Pyodide WASM runtime — no filesystem, network, or subprocess access by default. If you pass custom tools that do I/O, your tools' security posture is yours. Never hand raw subprocess.run to the RLM.
max_llm_calls left at default in a production path — runaway cost.context string — they get echoed into REPL state.dspy-gepa-optimizer.Manage Lark Wiki spaces, members, nodes, and document organization hierarchies.
Discover and call native Lark OpenAPI endpoints from official documentation when existing skills fall short.
Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.
writing beats
writing shape
writing fragments
Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.
Test-driven documentation for creating reusable agent techniques, patterns, and reference guides.
Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.
Builds and deploys Firebase SQL Connect (aka Firebase Data Connect) backends with PostgreSQL securely. Use when designing schemas with tables and relations, writing authorized queries and mutations, configuring real-time data updates, or generating type-safe SDKs. Use when you need a relational database with Firebase, or when the user mentions SQL Connect or Data Connect.
Guide for implementing smooth, native-feeling animations using React's View Transition API (`<ViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter/exit of components, animate list reorder, implement directional (forward/back) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.
README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.
Revolutionizing Video Production with AI-Powered Creativity
Streamline Your Content Creation with Easy Peasy AI.
social creators, marketers and small teams producing visual assets
Create AI art, images, and videos with prompts
Creative teams producing multi-asset campaigns
Instantly transform into anyone on video chats and streams.
A tool to automate personalized captions generation for photos.
AI-powered tools to spark creative writing.