Skip to content

AI-assisted development pattern library with automated metrics collection for continuous code quality improvement.

License

Notifications You must be signed in to change notification settings

doronpers/feedback-loop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

feedback-loop

Python License Tests Coverage

A practical framework for AI-assisted development with continuous learning from your code.

feedback-loop turns test failures into reusable patterns, then uses those patterns to improve code generation, review, and onboarding.

What it does

  • Learns from tests: captures failures and turns them into structured metrics.
  • Builds a living pattern library: good/bad examples + explanations.
  • Improves AI outputs: pattern-aware code generation and review.
  • Supports teams (optional): cloud sync and shared configuration.

Quick start

Installation

# Clone and install
git clone https://github.com/doronpers/feedback-loop.git
cd feedback-loop

# Core runtime
pip install -e .

# Or install with testing extras
pip install -e .[test]

🎯 Cursor Integration (Recommended)

For Cursor IDE users: feedback-loop provides seamless AI-powered development:

# 1. Install feedback-loop (see above)
# 2. Open this repository in Cursor
# 3. Cursor automatically reads .cursorrules file
# 4. Start coding with pattern-aware AI assistance!

See Cursor Integration Guide for:

  • Complete setup instructions
  • Pattern-aware code generation with Cursor Composer
  • Interactive workflows and tasks
  • Language server integration

Desktop Launchers (Easy Mode!)

Mac: Double-click launch-feedback-loop.command Windows: Double-click launch-feedback-loop.bat

These launchers provide an interactive menu to run any feedback-loop tool. See DESKTOP_LAUNCHERS.md for details.

Interactive setup

./bin/fl-setup

Chat assistant

./bin/fl-chat

See the patterns in action

python demo.py
python demo_metrics.py

Common workflows

# Collect metrics from pytest
pytest --enable-metrics

# Analyze and update patterns
feedback-loop analyze

# Generate code with pattern awareness
feedback-loop generate "Create a safe file handler"

Documentation

Memory-Enhanced Patterns (Optional)

feedback-loop now supports intelligent pattern memory via MemU, enabling:

✨ Semantic Search: Query patterns by concept, not just name 🧠 Self-Evolving: Patterns improve based on usage over time πŸ”— Cross-Project: Share learnings across all your codebases πŸ’‘ Smart Recommendations: Get context-aware pattern suggestions

Quick Setup

# 1. Install MemU
pip install memu-py

# 2. Enable memory (optional)
export FEEDBACK_LOOP_MEMORY_ENABLED=true
export OPENAI_API_KEY=sk-...  # For embeddings

# 3. Sync patterns to memory
feedback-loop memory sync

# 4. Query semantically
feedback-loop memory query "How do I handle JSON serialization with NumPy?"

# 5. Get recommendations
feedback-loop memory recommend --context "Building FastAPI file upload endpoint"

Note: Memory integration is opt-in and backward compatible. All existing functionality works without MemU.

See Memory Integration Guide for detailed documentation.

Core patterns (short list)

The framework ships with 9 production-tested patterns, including:

  • NumPy type conversion
  • NaN/Inf validation
  • Bounds checking
  • Specific exception handling
  • Structured logging
  • Temp file hygiene
  • Large file streaming
  • FastAPI streaming uploads
  • Metadata-driven logic

Use Quick Reference for the full catalog and examples.

Architecture (high-level)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            Tests            β”‚
β”‚          (pytest)           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚ failures
               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     Metrics Collector       β”‚
β”‚   (collector/analyzer)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     Pattern Library          β”‚
β”‚ (pattern_manager/generator)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     AI + Code Review         β”‚
β”‚   (pattern-aware outputs)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Apache Superset Dashboardsβ”‚
β”‚     (analytics/insights)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Analytics & Visualization

feedback-loop integrates with Apache Superset to provide powerful analytics dashboards:

πŸ“Š Code Quality Dashboard - Track bugs, test failures, and code review issues πŸ“ˆ Pattern Analysis Dashboard - Visualize pattern frequency and effectiveness πŸš€ Development Trends Dashboard - Monitor AI-assisted development metrics

See Superset Integration Guide for setup instructions.

Project status

See documentation/Status/RESULTS.md for test coverage and verification details.

Agent Instructions

CRITICAL: All AI agents MUST read AGENT_KNOWLEDGE_BASE.md before performing any tasks. It contains non-negotiable Patent, Security, and Design rules.

Additional resources:

About

AI-assisted development pattern library with automated metrics collection for continuous code quality improvement.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5