Procedural Store

pi-cyberneticsourcetypescript
Path: pi-cybernetic/src/storage/procedural-store.tsRelative: src/storage/procedural-store.tsSubproject: pi-cyberneticCategory: cybernetic-core
Lines: 78Bytes: 2,391Imports: 2Exports: 1

Content Preview

  1. /** Procedural memory — verified skills + working memory (active hypotheses). */
  2. import type { ActiveHypothesis, Evidence, VerifiedSkill } from "../types/index.ts";
  3. import { cosineSimilarity, nextId, termFrequency } from "../util.ts";
  4. export class ProceduralStore {
  5. private skills: VerifiedSkill[] = [];
  6. private hypotheses = new Map<string, ActiveHypothesis>();
  7. addSkill(name: string, tags: string[], pattern: string): VerifiedSkill {
  8. const existing = this.skills.find((skill) => skill.n