Skip to main content

KnowledgeStore

Defined in: types.ts:827

Filesystem-based knowledge store that accumulates execution and pattern events. Implements EventWriter so it can be used directly with createEventEmitter.

Extends​

Properties​

baseDir​

readonly baseDir: string

Defined in: types.ts:829

Base directory of the knowledge store.

Methods​

append()​

append(event): void

Defined in: types.ts:831

Persist an event and update the agent profile.

Parameters​

ParameterType
eventExecutionEvent | PatternEvent

Returns​

void


appendInsight()​

appendInsight(event): void

Defined in: types.ts:841

Persist an insight event generated by the insight engine.

Parameters​

ParameterType
eventInsightEvent

Returns​

void


compact()​

compact(options): { removed: number; }

Defined in: types.ts:839

Remove event files older than the given timestamp. Profiles are preserved.

Parameters​

ParameterType
options{ olderThan: number; }
options.olderThannumber

Returns​

{ removed: number; }

removed​

removed: number


getAgentProfile()​

getAgentProfile(agentId): AgentProfile | null

Defined in: types.ts:835

Get the derived profile for an agent, or null if no history.

Parameters​

ParameterType
agentIdstring

Returns​

AgentProfile | null


getPatternHistory()​

getPatternHistory(agentId, options?): PatternEvent[]

Defined in: types.ts:837

Query pattern event history for an agent.

Parameters​

ParameterType
agentIdstring
options?{ limit?: number; }
options.limit?number

Returns​

PatternEvent[]


getRecentEvents()​

getRecentEvents(agentId, options?): ExecutionEvent[]

Defined in: types.ts:833

Query recent execution events for an agent.

Parameters​

ParameterType
agentIdstring
options?{ limit?: number; since?: number; }
options.limit?number
options.since?number

Returns​

ExecutionEvent[]


getRecentInsights()​

getRecentInsights(agentId, options?): InsightEvent[]

Defined in: types.ts:843

Query recent insight events for an agent.

Parameters​

ParameterType
agentIdstring
options?{ limit?: number; type?: string; }
options.limit?number
options.type?string

Returns​

InsightEvent[]


write()​

write(graph): Promise<void>

Defined in: types.ts:252

Write the execution graph to the output target.

Parameters​

ParameterType
graphExecutionGraph

Returns​

Promise<void>

Inherited from​

EventWriter.write


writeEvent()​

writeEvent(event): Promise<void>

Defined in: types.ts:788

Write a structured event to the output target.

Parameters​

ParameterType
eventExecutionEvent | PatternEvent

Returns​

Promise<void>

Inherited from​

EventWriter.writeEvent