Skip to main content

KnowledgeStore

Defined in: types.ts:733

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:735

Base directory of the knowledge store.

Methods

append()

append(event): void

Defined in: types.ts:737

Persist an event and update the agent profile.

Parameters

ParameterType
eventExecutionEvent | PatternEvent

Returns

void


appendInsight()

appendInsight(event): void

Defined in: types.ts:747

Persist an insight event generated by the insight engine.

Parameters

ParameterType
eventInsightEvent

Returns

void


compact()

compact(options): { removed: number; }

Defined in: types.ts:745

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:741

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:743

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:739

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:749

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:181

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:694

Write a structured event to the output target.

Parameters

ParameterType
eventExecutionEvent | PatternEvent

Returns

Promise<void>

Inherited from

EventWriter.writeEvent