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
| Parameter | Type | Description |
|---|---|---|
store | KnowledgeStore | The knowledge store to query. |
Returns
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