Retrieval-Decision-Design (RDD)
Definition
RDD (Retrieval-Decision-Design) ist ein Reasoning-Muster that ties together Abruf (Abrufen relevanter Spezifikationen, Dokumentationen oder Beispiele), Entscheidung (making choices aligned with specs or policies), and Entwurf (producing outputs that satisfy requirements). It wird oft used in spec-driven development: behavior is guided by explicit specifications that are retrieved and enforced während der Generierung.
Funktionsweise
- Retrieval: Given the current task, retrieve relevant specification fragments, examples, or constraints (z. B. from a vector store or structured specs).
- Decision: Use the retrieved context to decide next steps, allowed actions, or output format.
- Design: Generate or execute in line mit dem spec; optionally validate outputs against the spec.
Dies kann in einer Agenten-Schleife implementiert werden: Spezifikation abrufen → mit Spezifikation im Kontext schlussfolgern → handeln oder generieren → validate → repeat. Das Diagramm unten zeigt the cycle: task triggers retrieve; retrieved spec feeds Entscheidung; generate/act erzeugt output; validate checks against the spec and can loop back to the task (z. B. retry or refine).
Anwendungsfälle
RDD passt, wenn outputs must align with retrievable specs (compliance, policy, or documented requirements).
- Spec-driven agents that retrieve requirements and validate outputs
- Compliance and policy-aware generation (z. B. legal, safety)
- Code or config generation aligned with documented specs
Vor- und Nachteile
| Pros | Cons |
|---|---|
| Outputs align with specs | Requires good spec coverage and Abruf |
| Reduces drift and ad-hoc behavior | Extra Abruf and validation cost |
| Fits regulated or safety-critical flows | Spec Entwurf and maintenance overhead |
Externe Dokumentation
- RAG paper (Lewis et al.) — Retrieval component used in RDD
- LangChain – Agents and tools — Orchestration patterns