Skip to content

uni-flow 公开 API(中文注解)


uni-flow 公开 API(中文注解) / EnhancedContextManager

Class: EnhancedContextManager

Defined in: layer4/enhanced-context-manager.ts:33

增强版 ContextManager:可挂载 VectorStore 与 LongTermMemoryStore。

Implements

Constructors

Constructor

new EnhancedContextManager(options?): EnhancedContextManager

Defined in: layer4/enhanced-context-manager.ts:42

Parameters

options?

EnhancedContextManagerOptions = {}

Returns

EnhancedContextManager

Methods

addVectorEntry()

addVectorEntry(entry, collection?): Promise<void>

Defined in: layer4/enhanced-context-manager.ts:155

Parameters

entry

MemoryEntry

collection?

string

Returns

Promise<void>


assemble()

assemble(unitId, policy, runId): Promise<AssembledContext>

Defined in: layer4/enhanced-context-manager.ts:48

Parameters

unitId

string

policy

ContextPolicy

runId

string

Returns

Promise<AssembledContext>

Implementation of

ContextManager.assemble


compact()

compact(unitId, strategy): Promise<void>

Defined in: layer4/enhanced-context-manager.ts:143

Parameters

unitId

string

strategy

CompactionStrategy

Returns

Promise<void>

Implementation of

ContextManager.compact


record()

record(unitId, input, output, runId): Promise<void>

Defined in: layer4/enhanced-context-manager.ts:105

Parameters

unitId

string

input

AgentInput

output

AgentOutput

runId

string

Returns

Promise<void>

Implementation of

ContextManager.record


rememberLongTerm()

rememberLongTerm(id, scope, content, metadata?): Promise<void>

Defined in: layer4/enhanced-context-manager.ts:163

Parameters

id

string

scope

string

content

string

metadata?

Record<string, unknown>

Returns

Promise<void>


search(query, options): Promise<MemoryEntry[]>

Defined in: layer4/enhanced-context-manager.ts:118

Parameters

query

string

options

SearchOptions

Returns

Promise<MemoryEntry[]>

Implementation of

ContextManager.search

MIT Licensed