feat(experience): self-evolution line 2 — capture & reuse concrete findings#42
Merged
Conversation
Adds ~/.arbor/skills/<domain>/ as a library tier (built-in < library < project) and a deterministic distiller: at finalize, merged/done node insights + the root global insight become a learned-<run>.md, auto-loaded by future runs via the existing LoadSkill flow. Off by default (coordinator.distill_skills); LLM-level abstraction + dedup are later refinements.
Distiller now emits altitude-tagged fragments: meta (cross-domain strategy from tree shape/pruned dead-ends) and domain (verified idea-class wins/losses). Task-specific findings stay in REPORT/trajectory, out of the library. Stored under skills/<level>/<domain>/; registry walks recursively. Recall can weight by altitude so high-level transfers widely, domain only on match.
Recover the project name from the session path when tree meta lacks a domain, so domain-layer skills file under skills/domain/<project>/ and recall can match by domain. Meta-layer stays general (cross-domain).
meta/ skills load everywhere; domain/<d>/ skills load only when <d> matches the current project name. A run reuses its own domain's lessons + cross-domain strategy, never an unrelated domain's task tricks. Deterministic, no LLM, no prompt.
…alize Two halves: append_experience logs a lesson each time the coordinator updates a node (status/insight) so the research *process* is kept, not just the surviving tree; the distiller then folds experience.jsonl into the cross-domain meta skill alongside tree shape. Sources = interaction-driven node updates + hypothesis tree.
One learned.md per (level,domain) that reinforces instead of one file per run. Dedup by normalized text; [xN] count = confidence, recurring lessons rank first. Repeated runs bump counts rather than pile up. Cross-run accumulation, no LLM.
… skill library Drop the global ~/.arbor/skills tier (was bloating the curated skill menu). Each run writes EXPERIENCE.md in its session; recall.find_similar scans past sessions and ranks by topic-term coverage. Intake surfaces strong matches and asks the user; accepted ones get composed for the agent (compose step next).
Intake system prompt lists past runs that left EXPERIENCE.md and tells the agent to offer the relevant one and ask the user (default yes) when the goal matches. compose_for_topic assembles a tailored block from topic-matched sessions for the agent. Closes the loop: store -> recall -> ask -> compose. No skill-menu bloat.
…le principles
distill_to_session takes a provider; when coordinator.distill_abstract is on, it
lifts task-specific bullets ('argpartition at d=16') to principles ('prefer
partial selection over full sort'). Any failure falls back to deterministic
bullets, so distillation never breaks. Off by default.
…instruction LaunchExperiment gains apply_experience: when the user agreed at intake, matched prior lessons are composed and prepended to the instruction the coordinator runs on. Off -> unchanged. store->recall->ask->compose->inject is now closed.
…n + fixes - Distill into transferable sections (Try first / Avoid / Key lever / Pitfalls / How to approach) via an LLM pass, with a clean deterministic fallback — what a next run actually needs to decide, not a win/loss dump. - Fix abstraction never firing: run the provider call in a thread so it works inside the live finalize loop (asyncio.run no longer raises). - Drop the heading-as-bullet wart; live capture now grabs the node's real insight. - Recall selection is LLM-driven: intake names experience_sessions it judged relevant; keyword match is only a fallback.
…l + B: mine) Replace the rigid 5-section template with what was actually wanted: specific, situational findings worth remembering next time on the same dataset/task/harness -- a dataset quirk that helps the metric, a trap an executor or harness fell into. - A: RecordFinding tool lets the agent log a finding the moment it hits one. - B: finalize mines the run for concrete findings that were never logged. EXPERIENCE.md is now free-form '[leverage|pitfall] about: note', deduped.
…bject The literal 'about:' in the format example made the model echo 'about' as the subject. Use SUBJECT in the template and blank any leaked about/subject placeholder.
…ence count Compose now dedups findings across the selected sessions and tags each [xN] = seen in N runs, ranking recurrent (more trustworthy) findings first. Cross-session confidence without a global library — fits the per-session storage model.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self-evolution line 2, stacked on #41. A run leaves concrete, situational findings; a later run on the same/similar target recalls them.
Capture (A+B)
RecordFindingtool: the agent logs a specific discovery the moment it hits one (a dataset quirk that helps, a trap an executor/harness fell into).Recall
EXPERIENCE.mdin its own session (no global skill-library bloat).[xN]recurrence count, injected into the launched instruction.Verified on a real run (claude/4141): the agent autonomously logged a macOS-
tasksetplatform pitfall and an argpartition 28x→40x trick; mining added GEMM-vs-cKDTree and a GIL dead-end. Off by default (coordinator.distill_skills). Live LLM calls run in a thread so they work inside the finalize loop.