agentleFS
zedarvateszedarvates/frugal-skills/skills/trajectory/SKILL.md

trajectory

Skill1 starsChanged 31 days agoMITView on GitHub

Instructions for the upstream workflow: Trajectory learning — stores solver trajectories and searches similar past optimizations to inform future decisions

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Trajectory learning

Package scope and prerequisites

This catalog ships instructions, not the executable runtime. Python modules, scripts, local services and optional tools named below must be installed separately from the upstream project. Check their availability before running commands; if they are missing, explain the prerequisite instead of claiming execution or results. The host agent may use model tokens while following these instructions.

Overview

Stocke les trajectoires d'optimisation des solveurs déterministes. Décrit la recherche de solutions antérieures similaires. Mesurer la latence, vérifier les prérequis et valider la pertinence avant réutilisation.

Compatible avec ~/.hermes/scripts/trajectory_search.py (Hermes Trajectory Memory).

Files

FichierRôle
skills/trajectory/__init__.pycapture(), search(), load(), stats()
skills/trajectory/store/trajectories.jsonlStockage JSON Lines

Usage

from skills.trajectory import capture, search, get_stats

# Capturer une trajectoire
tid = capture(
    solver="bin_pack",
    task="pack 3 database backups into 10GB capacity",
    parameters={"items": [("db1", 4), ("db2", 7), ("db3", 3)], "capacity": 10},
    result={"bins": [...], "bin_count": 2},
    latency=0.002,
    tokens_saved=500,
)

# Rechercher des trajectoires similaires
hits = search("pack items into capacity")
for h in hits:
    print(f"[{h['score']:.2f}] {h['trajectory']['task']}")

# Statistiques
stats = get_stats()
print(f"Total: {stats['total']}, Tokens saved: {stats['total_tokens_saved']}")

Integration with solvers

Dans skills/solvers/solvers.py, chaque fonction peut capturer sa trajectoire:

from skills.trajectory import capture

def assign_balanced(tasks, workers):
    result = ...  # existing logic
    capture("assign_balanced", f"assign {len(tasks)} tasks to {len(workers)} workers",
            {"tasks": tasks, "workers": workers}, result, latency=latency())
    return result

Integration with Hermes

Les fichiers sont compatibles: Botte peut lire les trajectoires Hermes et vice-versa:

# Lire les trajectoires Hermes
from skills.trajectory import load
hermes_trajs = load("~/.hermes/trajectory_store/trajectories.jsonl")

Pitfalls

  • Rotation automatique à 5000 entrées
  • TF-IDF uniquement — pas de sémantique profonde
  • Latence de capture < 1ms (append-only)
  • Thread-safe pour usage concurrent

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.