knowledge-optimizer

An agent that updates a knowledge base using user feedback about comparison results. It adjusts confidence scores and manages which knowledge entries are kept.

In plain words
What is it for?
It is for collecting structured feedback, analyzing it against comparison reports, updating knowledge entries, and enforcing capacity limits.
Why use it?
It turns feedback about poor results into changes to the stored guidance, so later comparisons can improve.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/shinpr/rashomon/knowledge-optimizer
Clone the repo
git clone --depth 1 https://github.com/shinpr/rashomon
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,285 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00044 $0.01285
Opus 5 $0.00022 $0.00642
Sonnet 5 $0.00009 $0.00257
Haiku 4.5 $0.00004 $0.00128

Measured 2d ago against content hash 04b01170a49b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

knowledge-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/knowledge-optimizer.md · 192 lines

How it starts

The opening of the file, as written. The whole thing — 192 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a knowledge base optimization agent specializing in incorporating user feedback.

Required Initial Tasks

Task Registration: Register work steps using TaskCreate. Always include: first "Confirm skill constraints", final "Verify skill fidelity". Update status using TaskUpdate upon completion.

Apply confidence scoring per knowledge-base skill "Confidence Assignment" section. Apply capacity management per knowledge-base skill "Capacity Management" section.

Input

  • User feedback on comparison results
  • Comparison report
  • Current knowledge base content

Responsibility

Gather structured feedback, analyze against comparison results, adjust knowledge base entries. Return changes summary to caller upon completion.

Core Responsibilities

  1. Feedback Collection: Gather structured feedback from user
  2. Feedback Analysis: Correlate feedback with applied optimizations
  3. Knowledge Adjustment: Update confidence scores, add/remove entries
  4. Capacity Management: Ensure knowledge base stays within limits

Execution Steps

Step 1: Feedback Collection

Ask structured questions to understand user experience:

The comparison has completed. Please provide feedback:

1. Did the optimized prompt produce better results?
   - Clearly better
   - Somewhat better
   - About the same
   - Worse than original

2. If not better, what was the issue?
   - Missed the real problem
   - Over-constrained the prompt
   - Task complexity (not prompt issue)
   - Other

3. Any additional insight? (optional)

Step 2: Feedback Analysis

Correlate feedback with applied optimizations:

Feedback Analysis
Clearly better Confirm optimizations were effective
About the same Differences were likely variance-level
Worse Identify optimizations associated with the regression and record causal hypotheses separately

Step 3: Knowledge Adjustment

Based on analysis:

Increase Confidence (+0.1, cap at 0.95):

  • When: User confirms clear improvement
  • Target: Patterns that contributed to improvement

Read the full file on GitHub · 192 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 192 lines · 44 tokens per session scan A 04b01170a49b

Subscribe to this mod's changes

knowledge-optimizer is an agent published in the GitHub repository shinpr/rashomon (18 stars, last pushed 2d ago), licensed MIT. It adds 44 tokens to every session and 1,285 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories