Quickstart: RAG-Grounded Code Generation
Run a retrieval-grounded code generation workflow that cites real attune APIs and workflow names — never invented ones.
from workflows.rag_code_gen import RagCodeGenWorkflow
workflow = RagCodeGenWorkflow()
result = workflow.execute()
print(result)
Prerequisites
- The project is cloned and installed locally
- You can import from
workflows.rag_code_gen
Steps
1. Import and instantiate
from workflows.rag_code_gen import RagCodeGenWorkflow
workflow = RagCodeGenWorkflow()
2. Execute the workflow
Call execute() to run retrieval and grounded generation:
result = workflow.execute()
3. Inspect the result
Print the returned WorkflowResult to confirm grounded output was produced:
print(result)
You should see a WorkflowResult containing generated code and citations drawn from retrieved attune-help context. Any API names, workflow names, or CLI commands in the output will reference real attune source files.
Next:
Read the concept page for RAG grounding to understand how retrieved passages are injected into the prompt and why the system prompt rejects invented attune features.
Unresolved references
Auto-generated by attune-author fact-check. Review and either fix the source code, fix this doc, or add an override.
| Location | Severity | Issue |
|---|---|---|
| Line 15 (code fence) | error | from workflows.rag_code_gen import … — module not importable |