Bridge Coach memory brief with project metrics summaries.

Add Performance Summary block to memory brief, document metrics synthesis in
agent-coach, and add e2e and CLI tests for qualitative plus quantitative briefs.
This commit is contained in:
2026-06-16 01:46:51 +02:00
parent 2711a3ebcc
commit 04fdc249f5
7 changed files with 134 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ from typing import List, Optional
from .registry import AgentRegistry, AgentCategory
from .installer import AgentInstaller, ProjectInitializer, InstallationConfig
from .metrics import MetricsStore, OptimizerStore
from .metrics import MetricsStore, OptimizerStore, performance_summary_markdown
from .optimization import OptimizationLoop, MIN_SAMPLES_FOR_RECOMMENDATIONS
@@ -892,12 +892,21 @@ def memory_brief(agent_name: str, target: str, raw: bool):
click.echo(f"Sources: {', '.join(sources) if sources else 'none'}")
click.echo()
if not sources:
metrics_store = MetricsStore(project_root, agent_name)
metrics_summary = metrics_store.read_summary()
if metrics_summary is None and metrics_store.executions_path.exists():
metrics_summary = metrics_store.write_summary()
if not sources and not metrics_summary:
click.echo("No agent memory files found in this project.")
click.echo(f" Run: kaizen-agentic memory init {agent_name}")
click.echo(" Then load the coach agent (agents/agent-coach.md) for synthesis.")
return
performance_block = performance_summary_markdown(metrics_summary or {})
if performance_block:
click.echo(performance_block)
# Own memory section
if own_memory:
click.echo("### Your Memory")