본문으로 건너뛰기
cccskills
무료GitHub에 공개

reasoningbank-intelligence

Adaptive learning for moflo agents via ReasoningBank: trajectory storage, verdict judgment, memory distillation, consolidation, and MMR retrieval. Use when building agents that should improve from experience across runs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

ReasoningBank Intelligence

Trajectory-based learning pipeline for moflo-enabled agents. Records what an agent did, judges the outcome, distills successful runs into reusable patterns, and retrieves relevant prior experience on the next task.

Prerequisites

  • moflo (the neural subsystem ships inline as part of the moflo package)
  • Moflo's memory DB at .swarm/memory.db (created on first run)

Quick Start

import { createInitializedReasoningBank } from 'moflo/dist/src/cli/neural/reasoning-bank.js';

const rb = await createInitializedReasoningBank({
  namespace: 'reasoning-bank',
  vectorDimension: 768,
  retrievalK: 3,
  mmrLambda: 0.7,              // 0=pure relevance, 1=pure diversity
  distillationThreshold: 0.6,  // min verdict score to keep
  dedupThreshold: 0.95,
});

The Pipeline

Four stages. You typically call each once per task:

1. Record trajectory  →  storeTrajectory({ id, input, actions, outcome, reward, ... })
2. Judge              →  const verdict = await rb.judge(trajectory)
3. Distill            →  const memory  = await rb.distill(trajectory)   // if verdict good enough
4. Retrieve (next task) →  const hits  = await rb.retrieveByContent(query, k)

1. Record

const trajectory = {
  id: taskId,
  input: userRequest,
  actions: ['read_file', 'edit_file', 'run_tests'],
  outcome: 'success' as const,
  reward: 1.0,                // 0..1
  metadata: { toolCalls: 3, durationMs: 1800 },
  timestamp: new Date(),
};

rb.storeTrajectory(trajectory);

2. Judge

The built-in judge scores on outcome + reward + action-step quality. No external LLM call.

const verdict = await rb.judge(trajectory);
// { score: 0-1, outcome: 'success' | ..., reasoning: string }

Swap in your own judge by extending ReasoningBank if you want LLM-in-the-loop scoring — this was designed as a rule-based baseline so the hot path stays cheap.

3. Distill

Compresses a trajectory into a reusable DistilledMemory (signature, approach, outcome-tagged). Skips if the verdict is below distillationThreshold.

const memory = await rb.distill(trajectory);
// null if verdict below threshold → not worth learning from

For batch runs (nightly, offline replay):

const memories = await rb.distillBatch(trajectories);

4. Retrieve

Query by text (embedding generated for you) or by pre-computed vector:

const hits = await rb.retrieveByContent(newTaskDescription, 5);
// [{ memory, relevanceScore, diversityScore, combinedScore }]

MMR (maximal marginal relevance) prevents the top-K from collapsing to "five slight variations of the same thing" — tune mmrLambda to push more diversity.

Consolidation

Memory quality degrades over time without maintenance. Run consolidation periodically (once a week, once after N new entries, etc.):

const result = await rb.consolidate();
// { removedDuplicates, contradictionsDetected, prunedPatterns, mergedPatterns }

Consolidation:

  • Removes duplicates above dedupThreshold similarity.
  • Detects contradictions (same signature, opposite outcomes) if enableContradictionDetection.
  • Prunes entries older than maxPatternAgeDays.
  • Merges semantically-adjacent patterns.

Persistence

ReasoningBank persists through MofloDbAdapter to .swarm/memory.db. Set enableMofloDb: false for ephemeral in-memory use (tests).

The namespace config isolates reasoning-bank entries from general memory. Default is reasoning-bank.

Anti-Patterns

  • Don't record every step as a separate trajectory. A trajectory = one task. Steps are a field inside the trajectory.
  • Don't skip the judge. Distilling every trajectory poisons the pool with failures — that's what distillationThreshold guards against.
  • Don't run consolidation on the hot path. It's a sweep — do it out-of-band.
  • Don't share namespace between different agent roles. Keep reasoning-bank:reviewer, reasoning-bank:researcher, etc. separate; signatures overlap otherwise.
  • Don't raise retrievalK to tame bad retrieval. Tune mmrLambda or the embedder instead — more K just dilutes the top results.

Integration with moflo's Hooks

Moflo's session/hook system already wires ReasoningBank into the /flo spell and the SubAgentStart hook. If you're building a custom agent that should participate, hook into post-task:

await mcp.hooks_post_task({
  trajectoryId: taskId,
  outcome: 'success',
  reward: 1.0,
});

That records, judges, and distills in one call.

Performance

  • Retrieve (k=5, corpus of 10k): ~3–8ms.
  • Distill: single call ≈ vector embed + a few similarity checks; ~10–50ms.
  • Consolidate: O(n²) in the namespace — run offline for corpora > 10k.

See Also

  • memory-patterns skill — for non-trajectory memory (sessions, knowledge)
  • memory-optimization skill — HNSW tuning, quantization
  • src/cli/neural/reasoning-bank.ts — full API
  • src/cli/services/learning-service.ts — trajectory types

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

commune

무료

Turn a vague idea into a concrete, actionable spec through a short Socratic dialogue, then hand the result off to an existing moflo surface — a /flo ticket, a spell, or memory. Use BEFORE you have a defined unit of work, when the goal is still fuzzy.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

eric-cielo/moflo192026년 10월 18일 업데이트

Scaffold new spell step commands and connectors. Use when building new step commands for spells or extending the spell engine with new capabilities. Connectors are for new I/O transport types OR platforms requiring complex multi-step interaction (e.g., browser-based automation).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

eric-cielo/moflo192026년 10월 18일 업데이트

distill

무료

Alias for /flo-simplify — see that skill's description.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

eric-cielo/moflo192026년 10월 18일 업데이트

divine

무료

Structured multi-hop web research with explicit confidence gating — plan the inquiry, search (WebSearch/WebFetch), score your own confidence, and keep digging until the answer is well-supported or a hop cap is hit, then emit a cited synthesis. Learns across sessions by storing each research case to memory and reusing prior strategies. Use when a question needs more than one search — comparisons, current-best-practice questions, anything where a single lookup leaves you unsure.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

eric-cielo/moflo192026년 10월 18일 업데이트

eldar

무료

Consult the Eldar — audit a project's moflo + Claude Code setup for portable, high-leverage gaps and guide remediation. Default mode is read-only audit with severity-ranked findings; --fix presents an interactive triage menu and walks the user through each chosen fix (healer, missing CLAUDE.md, sparse guidance, hook/MCP wiring, empty memory namespaces, stack→guidance gaps). Use when starting in a new project, when Claude feels lost or inefficient, when guidance/CLAUDE.md is sparse, or as a periodic health check.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

eric-cielo/moflo192026년 10월 18일 업데이트

flfl

무료

Run /fl on a ticket with moflo's three standing considerations loaded first — cross-platform (Rule

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

eric-cielo/moflo192026년 10월 18일 업데이트

eric-cielo의 스킬 모두 보기

이 스킬의 문제 신고