Building a coding agent with DSPy + Jev: six files, five layered agent patterns

dbreunig · x · 2026-10-01

dbreunig shares the repo cmpnd-ai/dspy-system-one-agent-patterns, which builds a coding agent on DSPy's RLM and TypeSafe's Jev decision model, demoing a set of compound AI design patterns (following his earlier reflections on the design choices KV caches force on us).

The repo structure is the tutorial: six small files build one coding agent, each adding a single design pattern on top of the previous — from a v0 baseline up to v5, covering a permission gate, relevant-tool selection, history-relevance filtering, and delegation. Every pattern follows the same rule: the signature states the question, Jev returns a probability, and plain Python owns the policy — the frontier model writes code inside a dspy.RLM sandbox while Jev answers closed questions probabilistically (is this command safe, which tool fits, does this past turn matter, could a helper take this step), with named thresholds turning probabilities into actions. Local Jev demos and a threshold-fitting script are included.

Original post →

More from coding & agent

coding & agent channel →