Fergana-Labs/stash

Open-source infrastructure for agents that learn from experience. Capture production traces and turn lessons into reusable knowledge and skills.

What Stash Is

Stash is an open‑source platform that lets you record what AI agents do, keep the useful bits of those interactions, and turn them into reusable “skills” that future agent runs can call. It provides:

  • Trace collection – hooks or an API that capture prompts, tool calls, responses and any human corrections made during a run.
  • Curated knowledge store – a background service that turns raw traces into durable, searchable pages in a “Memory wiki”.
  • Skill generation – the stored lessons can be packaged as a SKILL.md file (a set of instructions and assets) that agents can install and automatically keep up‑to‑date.
  • Reward‑model loop – optional functionality that extracts preference pairs from the traces, trains a reward model, and uses that model to suggest prompt improvements or generate new skills (via the GEPA system).

All of this is exposed through a Python SDK, a REST API, a command‑line client, and an “MCP” (presumably a model‑control‑plane) so it can be dropped into existing agent pipelines.


Why It Matters

  • Learning from production – Agents in the wild generate a lot of implicit feedback (successes, failures, human edits). Stash captures that data instead of discarding it.
  • Human‑in‑the‑loop – Reviewers can highlight a response and add a comment; Stash records the comment together with the original trace, turning ad‑hoc fixes into formal knowledge.
  • Reusable, versioned instructions – By turning a lesson into a SKILL.md file, the same guidance can be shared across many agents or runs without retraining the underlying model.
  • Closed‑loop improvement – The reward‑model component can automatically turn trace‑derived preferences into a signal that drives prompt optimisation or skill generation, enabling continuous improvement.

Who Might Use It

Audience How They Benefit
LLM‑powered product teams Capture support‑chat agent failures, turn them into reusable troubleshooting guides, and keep prompts tuned to real‑world metrics.
R&D labs building autonomous agents Store tool‑call histories and human corrections, then feed them back as curated knowledge or reward signals for faster iteration.
DevOps / MLOps engineers Deploy the backend services, use the CLI to install skills on agents, and monitor the reward‑model training pipeline.
Researchers in RLHF / preference learning Experiment with trace‑derived preference pairs and the built‑in reward‑model training workflow.

How to Get Started

  1. Run the stack – Follow docs/running-stash.md to spin up the backend services (Docker compose, etc.) or use the hosted version at joinstash.ai.
  2. Instrument your agents – Add the provided SDK hooks (or call the REST API) so each run sends prompts, tool calls, responses and any human corrections to Stash.
  3. Curate & review – Use the web UI to highlight problematic responses, add reviewer comments, and approve preference pairs.
  4. Train a reward model (optional) – Select traces, create a reward model, and let the background worker train it. The UI shows which preferences came from humans vs. AI judgments.
  5. Generate a skill – From a trained reward model, invoke GEPA to produce a SKILL.md file. Install it with stash skills install so future runs automatically load the new instruction set.
  6. Iterate – As agents run again, new traces are captured, curated, and can feed back into the loop, continuously refining prompts and skills.

Limitations & Open Questions

Issue Details
Self‑hosting complexity Running the full backend (trace store, curator, reward‑model workers, MCP) requires multiple services; the docs provide a guide but may need engineering effort.
Reward‑model maturity The reward‑model feature is described as an experimental product; performance depends on the quality of extracted preference pairs and may need careful validation.
Skill format Skills are simple SKILL.md folders; there is no standard schema yet, so integration with custom agents may require adapters.
Scalability of trace storage Large‑scale production agents can generate massive logs; the repo does not detail sharding or long‑term archiving strategies.

TL;DR

Stash is an open‑source system for recording agent interactions, turning human corrections into searchable knowledge, and packaging that knowledge as reusable skills. It also includes an experimental loop that extracts preferences from those traces to train reward models that can automatically improve prompts. Ideal for teams that want their agents to learn from real‑world experience without constantly retraining the base LLM.

Related

  • Project
  • Project
  • Project
  • Project
  • Project