@goosefactory/learning
GooseFactory Learning & Feedback Processing System — transforms human feedback into AI learning through a sophisticated 6-stage pipeline.
Quick Start
Start the Service
# Foreground (see logs directly)
./start-service.sh
# Background
./start-service.sh --bg
# Check status
./start-service.sh --status
# View logs
./start-service.sh --logs
# Stop
./start-service.sh --stop
Or Run Manually
npx tsx src/service.ts
The service will start on http://localhost:4001 (configure via LEARNING_PORT env var).
API Endpoints
Health Check
curl http://localhost:4001/health
Submit Feedback
curl -X POST http://localhost:4001/feedback \
-H "Content-Type: application/json" \
-d @test-feedback.json
Run Analysis
curl -X POST http://localhost:4001/analyze
Architecture
6-Stage Pipeline
- Validate - Zod schema validation, dedup, range checks
- Enrich - Time categorization, theme extraction, sentiment analysis
- Store - Append to JSONL, daily partitions
- Analyze - Pattern detection, calibration, trends
- Act - Update memory files, adjust thresholds
- Learn - Self-improvement loops, autonomy tiers
8 Feedback Types
- Decision - Approve/reject/needs-work with reasons
- Dimension Scores - 1-10 ratings across quality dimensions
- Free Text - Liked/disliked/general notes
- Comparison - A vs B preferences
- Annotations - Region-specific feedback (praise/criticism/questions)
- Confidence - Certainty levels and delegation decisions
- Estimation - Numeric estimates with context
- Batch Decisions - Bulk approve/reject flows
Plus: Temperature, Checklist, Ranking, Retrospective
5-Domain Pattern Analysis
- Approval Patterns - By server type, pipeline stage
- Dimension Trends - Quality metrics over time
- Theme Clustering - NLP-based pattern extraction
- Calibration - Confidence vs. actual accuracy
- Behavioral - Time patterns, fatigue, anomalies
Memory Files (4 Total)
feedback-patterns.md- Recurring themes and anti-patternsquality-standards.md- Dimension thresholds and calibrationjake-preferences.md- Personal taste modelimprovement-log.md- Changes to rules/thresholds/autonomy
Data Storage
Feedback Events
~/.config/goose/factory/feedback/raw/{YYYY-MM-DD}.jsonl
- One line per enriched feedback event
- Daily partitioned for easy archival
- Immutable append-only logs
Memory Files
~/.config/goose/factory/memory/
- Markdown format for human readability
- Auto-updated on analysis runs
- Versioned with timestamps
Configuration
Environment variables:
LEARNING_PORT- Service port (default: 4001)FEEDBACK_DATA_DIR- Data directory (default:~/.config/goose/factory)
Pipeline config (in service.ts):
{
dataDir: DATA_DIR,
memoryDir: `${DATA_DIR}/memory`,
analysisThreshold: 10, // Run analysis after N events
analyzeOnEvery: false, // Batch mode
minDataPointsForRules: 5, // Min data for rule generation
calibrationEnabled: true, // Enable confidence calibration
analysisDays: 30, // Days of data to analyze
}
Testing
Run Sample Test
# Submit test feedback with current timestamp
jq --arg ts "$(date -u +"%Y-%m-%dT%H:%M:%S.000Z")" \
'.timestamp = $ts' test-feedback.json | \
curl -X POST http://localhost:4001/feedback \
-H "Content-Type: application/json" \
-d @-
Check Results
# View stored events
cat ~/.config/goose/factory/feedback/raw/*.jsonl | jq .
# View memory files
cat ~/.config/goose/factory/memory/*.md
Integration
From API
import { processFeedback } from '@goosefactory/learning';
const result = await processFeedback(feedbackData, {
dataDir: '~/.config/goose/factory',
memoryDir: '~/.config/goose/factory/memory',
});
HTTP Call
curl -X POST http://localhost:4001/feedback \
-H "Content-Type: application/json" \
-d '{
"id": "feedback-123",
"timestamp": "2026-02-07T12:00:00Z",
"sessionId": "session-456",
"modalType": "decision-modal",
"workProduct": { ... },
"feedback": { ... },
"meta": { ... }
}'
Performance
- Validation: ~0.5ms per event
- Enrichment: ~0.3ms per event
- Storage: ~0.2ms per event
- Analysis: ~2ms for 30 days of data
- Memory updates: ~0.5ms per file
Total: ~1-2ms per feedback event
Self-Improvement Features
Pre-Check (Coming Soon)
- Validate work products before generation
- Check against learned patterns
- Prevent predictable failures
Prediction Tracking (Coming Soon)
- Store Buba's confidence predictions
- Compare against actual outcomes
- Continuous calibration
Diminishing Review (Coming Soon)
- 5-tier autonomy system
- Auto-approve based on pattern confidence
- Regression detection and rollback
Development
Build
npm run build
Type Check
npm run typecheck
Watch Mode
npm run dev
Files
src/index.ts- Library exportssrc/service.ts- HTTP servicesrc/types.ts- Zod schemas + TypeScript typessrc/pipeline/- 6-stage processing pipelinesrc/storage/- JSONL storage + queriessrc/analysis/- Pattern detection + calibrationsrc/memory/- Memory file writers/readerssrc/improvement/- Self-improvement loopssrc/metrics/- KPIs and dashboard stats
Status
✅ All core features implemented and tested
See LEARNING_PIPELINE_REPORT.md for full test results.
Next Steps
- Integration - Connect to API and desktop app
- Monitoring - Add metrics endpoint and alerts
- Enhancement - Diminishing review, pre-check, prediction tracking
- UI - Admin dashboard for memory file review
Part of the GooseFactory ecosystem.