Skip to main content

createPolicySource()

createPolicySource(store): PolicySource

Defined in: policy-source.ts:31

Create a PolicySource backed by a knowledge store.

All methods delegate to the store's profile data. The PolicySource is a pure read interface — it never writes to the store.

Parameters

ParameterTypeDescription
storeKnowledgeStoreThe knowledge store to query.

Returns

PolicySource

A PolicySource for use with adaptive guards.

Example

const store = createKnowledgeStore({ baseDir: '.agentflow/knowledge' });
const policy = createPolicySource(store);
const rate = policy.recentFailureRate('my-agent'); // 0.0–1.0