Skip to content

Graphorin API reference v0.4.0


Graphorin API reference / @graphorin/memory / / ProceduralMemory

Class: ProceduralMemory

Defined in: packages/memory/src/tiers/procedural-memory.ts:93

ProceduralMemory — standing orders activated when the agent's current context matches the rule's predicate. The activation rules are deterministic so the agent runtime + ContextEngine can render the active set into the system prompt every step.

P2-2 adds ProceduralMemory.induce: distil a reusable workflow from a successful agent trajectory and store it quarantined (it must not drive actions until validated). Quarantined procedures are excluded from ProceduralMemory.activate but remain visible to ProceduralMemory.list.

Stable

Constructors

Constructor

ts
new ProceduralMemory(args): ProceduralMemory;

Defined in: packages/memory/src/tiers/procedural-memory.ts:99

Parameters

ParameterType
args{ inducer?: | WorkflowInducer | null; store: MemoryStoreAdapter; tracer: Tracer; }
args.inducer?| WorkflowInducer | null
args.storeMemoryStoreAdapter
args.tracerTracer

Returns

ProceduralMemory

Methods

activate()

ts
activate(scope, context?): Promise<readonly Rule[]>;

Defined in: packages/memory/src/tiers/procedural-memory.ts:249

Return the rules active under context. Rules without a condition are always active; the bundled predicate vocabulary supports the literals 'always', 'topic=<topic>', and 'tag=<tag>'. Anything outside that grammar is treated as always-active so callers do not silently lose rules.

Quarantined procedures are excluded (P1-4 / P2-2): an induced procedure must not drive actions until validated, so activation — which feeds the system prompt — never surfaces it.

Parameters

ParameterType
scopeSessionScope
contextRuleActivationContext

Returns

Promise&lt;readonly Rule[]&gt;


define()

ts
define(scope, input): Promise<Rule>;

Defined in: packages/memory/src/tiers/procedural-memory.ts:110

Persist a rule. Returns the stored record.

Parameters

ParameterType
scopeSessionScope
inputRuleInput

Returns

Promise&lt;Rule&gt;


induce()

ts
induce(
   scope, 
   trajectory, 
opts?): Promise<Rule | null>;

Defined in: packages/memory/src/tiers/procedural-memory.ts:152

Induce a reusable procedure (P2-2) from a successful agent trajectory and store it quarantined + provenance: 'induction' (P1-4). Returns the stored Rule, or null when the trajectory was unsuccessful / empty or the inducer produced nothing inducible.

Throws ProcedureInductionNotConfiguredError when no inducer was configured (createMemory({ procedureInduction: { provider } })).

Parameters

ParameterType
scopeSessionScope
trajectoryTrajectory
optsInduceOptions

Returns

Promise&lt;Rule | null&gt;


induceFromRun()

ts
induceFromRun(
   scope, 
   run, 
opts?): Promise<Rule | null>;

Defined in: packages/memory/src/tiers/procedural-memory.ts:208

Convenience over induce: distil the Trajectory from a completed RunState (the agent's already-emitted run state) and induce a procedure. The success signal is status === 'completed'.

Parameters

ParameterType
scopeSessionScope
runRunState
optsInduceOptions

Returns

Promise&lt;Rule | null&gt;


list()

ts
list(scope): Promise<readonly Rule[]>;

Defined in: packages/memory/src/tiers/procedural-memory.ts:230

List every active (non-deleted) rule for the supplied scope.

Parameters

ParameterType
scopeSessionScope

Returns

Promise&lt;readonly Rule[]&gt;


remove()

ts
remove(
   scope, 
   ruleId, 
reason?): Promise<void>;

Defined in: packages/memory/src/tiers/procedural-memory.ts:217

Soft-delete a rule.

Parameters

ParameterType
scopeSessionScope
ruleIdstring
reason?string

Returns

Promise&lt;void&gt;