Feedback Loop
Iterate on AI-generated solutions with natural language feedback
The Feedback Loop feature allows you to iteratively improve Tembo’s AI-generated solutions by providing natural language feedback directly on GitHub pull requests. When you comment with feedback, Tembo automatically retries and updates the PR with improved code.
How It Works
- Initial Solution: Tembo creates a pull request to solve an issue
- Review & Comment: You review the PR and leave feedback mentioning “tembo” or “@tembo”
- Automatic Retry: Tembo processes your feedback and updates the PR with improvements
- Iteration: Continue providing feedback until you’re satisfied with the solution
Getting Started
Step 1: Review the Generated PR
When Tembo creates a pull request for an issue, you’ll receive a GitHub notification. Review the changes and identify areas for improvement.
Step 2: Leave Feedback
Comment on the pull request with your feedback. Important: Make sure to mention “tembo” or “@tembo” in your comment for the system to detect it.
Example comments:
Step 3: Watch Tembo Respond
Once you post your comment:
- 👀 Eyes Reaction: Tembo acknowledges your feedback
- 🚀 Rocket Reaction: Tembo starts processing the changes
- Updated PR: New commits appear with improvements based on your feedback
Advanced Features
Context-Aware Updates
Tembo considers multiple sources when updating your PR:
- Your Comments: All feedback comments on the PR
- Existing Code: The current state of the repository
- PR Diff: The changes already made
- Original Issue: The problem being solved
Credit Management
Each feedback iteration consumes organization credits. Ensure your organization has sufficient credits before requesting changes.
Status Tracking
Tembo automatically tracks PR status:
- Open: PR is active and can receive feedback
- Merged: PR has been merged into the main branch
- Closed: PR was closed without merging
Best Practices
Writing Effective Feedback
✅ Be Specific
❌ Too Vague
✅ Request Concrete Changes
❌ General Comments
Multiple Iterations
You can provide feedback multiple times on the same PR. Each comment mentioning Tembo triggers a new update cycle, allowing for iterative refinement.
Code Quality Requests
Tembo can help with:
- Performance Optimization: “optimize this query for better performance”
- Error Handling: “add proper error handling and logging”
- Code Structure: “refactor this into smaller, more maintainable functions”
- Type Safety: “add proper TypeScript types”
- Testing: “include unit tests for this functionality”
- Documentation: “add JSDoc comments to these functions”
Technical Implementation
The Feedback Loop integrates several components:
GitHub Webhook Processing
- Listens for
issue_comment.created
events - Filters comments mentioning “tembo” or “@tembo”
- Validates the comment is on a Tembo-created PR
- Queues feedback processing jobs
Reference: tembo-v2/apps/api/src/server.ts:78-243
AI Processing
- Extracts all PR comments for context
- Analyzes the existing code diff
- Generates improved solutions based on feedback
- Commits changes to the PR branch
Reference: tembo-v2/apps/agent/src/jobs/solve_issue.rs
Visual Feedback
- 👀 Reaction: Feedback acknowledged
- 🚀 Reaction: Processing started
- New Commits: Updated solution pushed
Troubleshooting
Tembo Isn’t Responding to Comments
Check these requirements:
- Mention Detection: Comment must include “tembo” or “@tembo”
- PR Source: PR must be created by
tembo-io[bot]
- User Type: Comment must be from a human user (not a bot)
- Organization Credits: Sufficient credits must be available
- Integration Status: GitHub integration must be active
Feedback Not Applied Correctly
- Be More Specific: Provide clearer, more detailed feedback
- Check Context: Ensure your feedback relates to the existing PR changes
- Multiple Comments: Break complex feedback into smaller, focused comments
PR Status Issues
If PR status isn’t updating correctly:
- Verify GitHub webhook delivery in your repository settings
- Check organization integration status in Tembo dashboard
- Ensure proper repository permissions for the Tembo GitHub App
Rate Limits
To prevent excessive API usage:
- Each comment triggers one feedback processing cycle
- Multiple mentions in the same comment count as one request
- Bot comments are automatically ignored to prevent loops
The Feedback Loop makes AI-generated code truly collaborative, allowing you to guide Tembo toward the exact solution you need through natural language feedback.