feat(openclaw): skills-based memory architecture with batched extraction (#4624)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
e2b439c42a
commit
c250ccfb5c
@@ -28,6 +28,8 @@ export type Mem0Config = {
|
||||
autoRecall: boolean;
|
||||
searchThreshold: number;
|
||||
topK: number;
|
||||
// Agentic harness skills
|
||||
skills?: SkillsConfig;
|
||||
};
|
||||
|
||||
export interface AddOptions {
|
||||
@@ -38,6 +40,12 @@ export interface AddOptions {
|
||||
enable_graph?: boolean;
|
||||
output_format?: string;
|
||||
source?: string;
|
||||
// Agentic harness additions
|
||||
infer?: boolean;
|
||||
deduced_memories?: string[];
|
||||
metadata?: Record<string, unknown>;
|
||||
expiration_date?: string;
|
||||
immutable?: boolean;
|
||||
}
|
||||
|
||||
export interface SearchOptions {
|
||||
@@ -48,9 +56,65 @@ export interface SearchOptions {
|
||||
limit?: number;
|
||||
keyword_search?: boolean;
|
||||
reranking?: boolean;
|
||||
filter_memories?: boolean;
|
||||
categories?: string[];
|
||||
filters?: Record<string, unknown>;
|
||||
source?: string;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Skills Configuration Types
|
||||
// ============================================================================
|
||||
|
||||
export interface CategoryConfig {
|
||||
importance: number;
|
||||
ttl: string | null; // e.g. "7d", "90d", null = permanent
|
||||
immutable?: boolean;
|
||||
}
|
||||
|
||||
export interface SkillsConfig {
|
||||
triage?: {
|
||||
enabled?: boolean;
|
||||
importanceThreshold?: number;
|
||||
enableGraph?: boolean;
|
||||
credentialPatterns?: string[];
|
||||
};
|
||||
recall?: {
|
||||
/** Master switch. false = no auto-recall regardless of strategy. */
|
||||
enabled?: boolean;
|
||||
/** Controls auto-recall behavior. Only consulted when enabled !== false.
|
||||
* "smart" (default): long-term search only, 1 search/turn.
|
||||
* "manual": zero plugin searches, agent controls all search.
|
||||
* "always": long-term + session search, 2 searches/turn. */
|
||||
strategy?: "always" | "smart" | "manual";
|
||||
tokenBudget?: number;
|
||||
maxMemories?: number;
|
||||
rerank?: boolean;
|
||||
keywordSearch?: boolean;
|
||||
filterMemories?: boolean;
|
||||
threshold?: number;
|
||||
identityAlwaysInclude?: boolean;
|
||||
categoryOrder?: string[];
|
||||
};
|
||||
dream?: {
|
||||
enabled?: boolean;
|
||||
/** Enable automatic triggering based on activity gates. Default: true when dream enabled. */
|
||||
auto?: boolean;
|
||||
/** Minimum hours between consolidations. Default: 24. */
|
||||
minHours?: number;
|
||||
/** Minimum interactive sessions before triggering. Default: 5. */
|
||||
minSessions?: number;
|
||||
/** Minimum total memories to justify consolidation. Default: 20. */
|
||||
minMemories?: number;
|
||||
};
|
||||
domain?: string;
|
||||
customRules?: {
|
||||
include?: string[];
|
||||
exclude?: string[];
|
||||
};
|
||||
categories?: Record<string, CategoryConfig>;
|
||||
}
|
||||
|
||||
export interface ListOptions {
|
||||
user_id: string;
|
||||
run_id?: string;
|
||||
@@ -87,5 +151,8 @@ export interface Mem0Provider {
|
||||
search(query: string, options: SearchOptions): Promise<MemoryItem[]>;
|
||||
get(memoryId: string): Promise<MemoryItem>;
|
||||
getAll(options: ListOptions): Promise<MemoryItem[]>;
|
||||
update(memoryId: string, text: string): Promise<void>;
|
||||
delete(memoryId: string): Promise<void>;
|
||||
deleteAll(userId: string): Promise<void>;
|
||||
history(memoryId: string): Promise<Array<{ id: string; old_memory: string; new_memory: string; event: string; created_at: string }>>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user