Repository navigation
Closed
Labels
agentsAgent frameworkenhancementNew feature or requestresearchResearch, methodology, ablationsv2.0.1Planned for v2.0.1 release
Milestone
Description
Summary
Build a SelfImprovingAgent that uses production traces to autonomously rewrite its own prompts, tool definitions, and routing rules — gated by the existing @eval_case suite and PromptOptimizer.
Motivation
We already ship the building blocks: ContinuousTrainer, FeedbackCollector, A/B testing, AutoRolloutManager, PromptOptimizer, CostQualityRouter. Today they require a human in the loop to interpret signals and apply changes. The next leap is closing that loop: the agent proposes its own config diff, the eval harness validates it, and AutoRolloutManager ships it canary-style.
No competitor in the LangChain ecosystem has a clean, governed self-improvement loop. This becomes the headline feature of v2.0.
Design Sketch
from synapsekit import SelfImprovingAgent, EvalSuite, RolloutPolicy
agent = SelfImprovingAgent(
base_agent=my_agent,
eval_suite=EvalSuite.from_decorators(),
rollout=RolloutPolicy(
canary_pct=5,
min_eval_score=0.85,
rollback_on_regression=True,
require_human_approval_for=[\"tool_addition\", \"prompt_rewrite\"],
),
improvement_targets=[\"prompt\", \"tool_selection\", \"routing\", \"few_shot_examples\"],
cadence=\"every_1000_runs\",
)Loop
- Observe — collect last N traces via
FeedbackCollector - Diagnose — meta-LLM analyzes failure clusters
- Propose — generates candidate diffs (new prompt, new tool, new routing rule)
- Validate —
PromptOptimizerscores candidates againstEvalSuite - Canary —
AutoRolloutManagerships to 5% traffic - Promote or rollback — automated based on live KPIs
- Audit log — every change is a signed, reversible
AgentConfigPatch
Required Components
-
SelfImprovingAgentwrapper class -
AgentConfigPatch— diff format for prompts/tools/routing -
MetaAnalyzer— usesReasoningLLMto cluster failures -
RolloutPolicy— declarative guardrails - Audit trail (signed, replay-able)
- CLI:
synapsekit agent inspect-evolution <agent-id> - Eval-blocked default: a patch can NEVER ship without passing the eval suite
- Integration with
PrometheusMetrics(emitagent_evolution_*gauges)
Risks / Open Questions
- Governance: should tool addition require human approval by default? (proposed: yes)
- Reward hacking: agent could optimize for eval suite without improving real quality — need adversarial eval cases
- Cost runaway: meta-LLM analysis on every cycle is expensive — cadence must be tunable
- Reproducibility: replay-from-patch must be deterministic
Acceptance Criteria
- End-to-end demo: agent autonomously improves accuracy on a benchmark task over 5 evolution cycles
- All patches reversible via
agent.rollback(patch_id) - Full audit log queryable via
agent.evolution_history() - Docs page + example notebook
- 100% branch coverage on rollout policy
Related
- Builds on
ContinuousTrainer(feat: FineTuningPipeline added #714),PromptOptimizer,CostQualityRouter - Pairs naturally with #neuro-symbolic for verifiable self-improvement
Metadata
Metadata
Assignees
Labels
agentsAgent frameworkenhancementNew feature or requestresearchResearch, methodology, ablationsv2.0.1Planned for v2.0.1 release
Activity
AmitoVrito commentedon Aug 1, 2026
Status: implementation complete — acceptance-criteria polish pending
Shipped (in
src/synapsekit/agents/self_improving.py+training/):SelfImprovingAgent(eval-blocked, grounded gate),AgentConfigPatch(signed + reversible),MetaAnalyzer,RolloutPolicy,rollback(patch_id),evolution_history(),_validate_patch(eval gate), CLIsynapsekit agent inspect-evolution, Prometheusagent_evolution_*gauges, 14 tests,examples/self_improving_agent.py.Pending to close this issue (acceptance criteria):
benchmarks/self_evolving_bench.py+benchmarks/test_self_evolving_bench.pygate + aself-evolving-gateCI job (same pattern asagent-swarm-market-gate).Satiankit96 commentedon Aug 1, 2026
W0Ankit_00
ci: add self-evolving-gate job for SynapseKit#732
test(agents): self-evolving acceptance benchmark + CI gate (#732)
docs(readme): v2.0.1 note, self-evolving notebook link, fix provider …
release: v2.0.1
Merge pull request #918 from SynapseKit/release/v2.0.1
AmitoVrito commentedon Aug 4, 2026
Closed in v2.0.1. All acceptance criteria met:
benchmarks/self_evolving_bench.py(37.5% → 100%), CI-gated byself-evolving-gateagent.rollback(patch_id)agent.evolution_history()+synapsekit agent inspect-evolutiondocs/agents/self-improving.md) + example notebook (examples/self_evolving_agent.ipynb, offline & CI-tested)RolloutPolicy(24/24 branches)Bonus: the evolution loop now streams to the SynapseKit Live dashboard (
agent.evolve/agent.rollbackevents).docs(agents): self-evolving example notebook + CI-tested runner (Syna…