feat: add self-reflection step before presenting roadmap#7
Conversation
|
🗺️ Auto-Generated Review Roadmap
Review Roadmap for PR #7: Self-Reflection StepHigh-Level SummaryThis PR implements a self-reflection pattern where the agent reviews its own generated roadmap before presenting it to users. The key addition is a feedback loop: after drafting a roadmap, a new Recommended Review Order1. State Model First (Foundation)Start with state.py to understand the new state fields being threaded through the workflow:
2. Prompts (The Reflection Criteria)Review prompts.py next:
3. Node Implementation (Core Logic)The nodes.py file contains the new
4. Graph Workflow (Orchestration)With understanding of state and nodes, review graph.py:
5. Entry PointReview main.py:
6. Test SuiteReview tests in order of dependency:
7. DocumentationFinish with README.md to verify user-facing docs match implementation. Watch OutsLogic Concerns
Edge Cases
Testing Gaps
Security/Performance
Existing DiscussionsNo comments have been left on this PR yet. You'll be the first reviewer—consider focusing on the core logic in |
Implements the self-reflection pattern from issue #6, where the agent reviews its own output before presenting it to users. This catches issues like missing files, generic advice, or unclear reasoning. Changes: - Add reflect_on_roadmap node that evaluates the generated roadmap - Add conditional routing to retry roadmap generation if issues found - Limit retries to 2 iterations to prevent infinite loops - Add --no-reflection flag to skip reflection for faster results - Update draft_roadmap to incorporate feedback on retries The reflection step checks for: - Completeness (all files mentioned) - Logical review order - Specificity (not generic boilerplate) - Accuracy of summaries Closes #6
The JSON examples in REFLECT_ON_ROADMAP_SYSTEM_PROMPT were being interpreted as template variables by LangChain's ChatPromptTemplate. Double curly braces escape them as literal text.
1b1500d to
ccc439e
Compare
Summary
Implements the self-reflection pattern from issue #6, where the agent reviews its own output before presenting it to users. This catches issues like missing files, generic advice, or unclear reasoning—improving quality without manual review.
Changes
New Node:
reflect_on_roadmapConditional Routing
draft_roadmap, the workflow routes to reflectiondraft_roadmapwith feedbackCLI Flag
--no-reflectionflag to skip reflection for faster resultsArchitecture
Testing
Closes #6