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
new ProceduralMemory(args): ProceduralMemory;Defined in: packages/memory/src/tiers/procedural-memory.ts:99
Parameters
| Parameter | Type |
|---|---|
args | { inducer?: | WorkflowInducer | null; store: MemoryStoreAdapter; tracer: Tracer; } |
args.inducer? | | WorkflowInducer | null |
args.store | MemoryStoreAdapter |
args.tracer | Tracer |
Returns
ProceduralMemory
Methods
activate()
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
| Parameter | Type |
|---|---|
scope | SessionScope |
context | RuleActivationContext |
Returns
Promise<readonly Rule[]>
define()
define(scope, input): Promise<Rule>;Defined in: packages/memory/src/tiers/procedural-memory.ts:110
Persist a rule. Returns the stored record.
Parameters
| Parameter | Type |
|---|---|
scope | SessionScope |
input | RuleInput |
Returns
Promise<Rule>
induce()
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
| Parameter | Type |
|---|---|
scope | SessionScope |
trajectory | Trajectory |
opts | InduceOptions |
Returns
Promise<Rule | null>
induceFromRun()
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
| Parameter | Type |
|---|---|
scope | SessionScope |
run | RunState |
opts | InduceOptions |
Returns
Promise<Rule | null>
list()
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
| Parameter | Type |
|---|---|
scope | SessionScope |
Returns
Promise<readonly Rule[]>
remove()
remove(
scope,
ruleId,
reason?): Promise<void>;Defined in: packages/memory/src/tiers/procedural-memory.ts:217
Soft-delete a rule.
Parameters
| Parameter | Type |
|---|---|
scope | SessionScope |
ruleId | string |
reason? | string |
Returns
Promise<void>