feat(agent): closed feedback→behavior loop — adapt routing/prompts/skills from captured human signals #10545
Description
Closed feedback→behavior loop
Part of umbrella #10542 · Theme A (collaboration core) · highest-leverage latent asset
Problem
AutoBot captures everything needed to get measurably better at a given user/org over time — approvals, rejections, agent diary, user-scoped retrieval signals, replay logs — but the data is not yet wired into a loop that changes behavior. The agent does not learn "humans here keep rejecting my X, so shift routing/prompt/skill-selection." The hard part (capture) is done; the last wire (consume) is missing.
What exists today
routers/feedback.py— feedback capture endpoint.rlm/evaluator.py+rlm/rag_refiner.py— within-response self-critique loop (Research: Recursive Language Model (RLM) patterns for AutoBot #1373).memory/agent_diary.py,memory/essential_story.py, trajectory store.knowledge/.../retrieval_learner*— user-scoped retrieval learning already exists.llc/models/replay_log.py+llc/api/replay.py— replay logs.- Approval decisions flow through
agent_loop/approval_workflow.py.
What to build
- A preference/feedback aggregator that turns captured approvals/rejections/edits/diary reflections into durable, queryable signals scoped per user + per org + per task-class.
- Consumption hooks:
AgentRouter/StrategyPlanner/prompt_managerread those signals to bias routing, skill selection, and prompt assembly. - Generalize the existing per-retrieval learner into a cross-cutting learning surface (don't duplicate — extend it).
- Guardrails: bounded influence, explainable ("adjusted because humans rejected Y 4×"), per-tenant isolation.
Acceptance criteria
- Repeated rejection of a behavior in a tenant demonstrably shifts the agent's next choice (test on a seeded feedback set).
- Adjustments are explainable and surfaced in the trajectory.
- Signals are tenant-isolated; no cross-org leakage.
- Extends existing retrieval_learner / diary rather than adding a parallel store.
Entry points
autobot-backend/routers/feedback.py · autobot-backend/memory/agent_diary.py · autobot-backend/knowledge/search_components/ (retrieval_learner) · autobot-backend/orchestration/agent_registry.py + enhanced_orchestration/workflow_planning.py (consumption) · autobot-backend/prompt_manager.py.
Activity
mrveiss commentedon Jun 28, 2026
Two concrete, PR-sized sub-slices of this loop, each pinning an exact computed-but-discarded signal with file:line evidence (from Ornith-1.0 research):
best_prompt_templateis learned + stored + API-exposed but has 0 runtime consumers (routing.py:126only usesbest_approach). The scaffold half of the learned strategy is thrown away.similar_trajectoriesare fetched with reward filtering atworkflow_planner.py:288-293then never read; the docstring at:99admits "step generation always builds from scratch."These can land independently before the broader per-tenant aggregator described here.
chore(codegen): regenerate workflow.ts frontend types — resolves chec…
fix(codegen): render PEP 604 `X | None` unions as optional typed fiel…
feat(agent): closed feedback→behavior loop — bounded explainable rout…
mrveiss commentedon Jul 6, 2026
Delivered via PR #10981 — closed feedback→behavior loop (aggregator + bounded explainable routing/prompt/skill bias). Also root-caused + fixed the frontend-codegen generator to render PEP 604
X | Noneunions deterministically across Python 3.10/3.14 (was the drift source).fix(prompt): wire preference AND skill clauses into prompt assembly —…