openclaw-cortex-memory 0.1.0-Alpha.30 → 0.1.0-Alpha.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +46 -12
- package/SIGNATURE.md +7 -0
- package/SKILL.md +18 -3
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +148 -6
- package/dist/index.js.map +1 -1
- package/dist/openclaw.plugin.json +120 -4
- package/dist/src/engine/memory_engine.d.ts +5 -1
- package/dist/src/engine/memory_engine.d.ts.map +1 -1
- package/dist/src/engine/ts_engine.d.ts +116 -0
- package/dist/src/engine/ts_engine.d.ts.map +1 -1
- package/dist/src/engine/ts_engine.js +417 -102
- package/dist/src/engine/ts_engine.js.map +1 -1
- package/dist/src/engine/types.d.ts +17 -0
- package/dist/src/engine/types.d.ts.map +1 -1
- package/dist/src/graph/ontology.d.ts +23 -1
- package/dist/src/graph/ontology.d.ts.map +1 -1
- package/dist/src/graph/ontology.js +743 -70
- package/dist/src/graph/ontology.js.map +1 -1
- package/dist/src/quality/llm_output_validator.d.ts +20 -2
- package/dist/src/quality/llm_output_validator.d.ts.map +1 -1
- package/dist/src/quality/llm_output_validator.js +296 -41
- package/dist/src/quality/llm_output_validator.js.map +1 -1
- package/dist/src/store/archive_store.d.ts +8 -0
- package/dist/src/store/archive_store.d.ts.map +1 -1
- package/dist/src/store/archive_store.js +244 -84
- package/dist/src/store/archive_store.js.map +1 -1
- package/dist/src/store/graph_memory_store.d.ts +72 -2
- package/dist/src/store/graph_memory_store.d.ts.map +1 -1
- package/dist/src/store/graph_memory_store.js +723 -50
- package/dist/src/store/graph_memory_store.js.map +1 -1
- package/dist/src/store/read_store.d.ts +3 -0
- package/dist/src/store/read_store.d.ts.map +1 -1
- package/dist/src/store/read_store.js +1004 -209
- package/dist/src/store/read_store.js.map +1 -1
- package/dist/src/store/vector_store.d.ts +1 -0
- package/dist/src/store/vector_store.d.ts.map +1 -1
- package/dist/src/store/vector_store.js +1 -0
- package/dist/src/store/vector_store.js.map +1 -1
- package/dist/src/store/write_store.d.ts +2 -0
- package/dist/src/store/write_store.d.ts.map +1 -1
- package/dist/src/store/write_store.js +45 -3
- package/dist/src/store/write_store.js.map +1 -1
- package/dist/src/sync/session_sync.d.ts +20 -1
- package/dist/src/sync/session_sync.d.ts.map +1 -1
- package/dist/src/sync/session_sync.js +1810 -161
- package/dist/src/sync/session_sync.js.map +1 -1
- package/dist/src/wiki/wiki_linter.d.ts +25 -0
- package/dist/src/wiki/wiki_linter.d.ts.map +1 -0
- package/dist/src/wiki/wiki_linter.js +268 -0
- package/dist/src/wiki/wiki_linter.js.map +1 -0
- package/dist/src/wiki/wiki_logger.d.ts +10 -0
- package/dist/src/wiki/wiki_logger.d.ts.map +1 -0
- package/dist/src/wiki/wiki_logger.js +78 -0
- package/dist/src/wiki/wiki_logger.js.map +1 -0
- package/dist/src/wiki/wiki_maintainer.d.ts +36 -0
- package/dist/src/wiki/wiki_maintainer.d.ts.map +1 -0
- package/dist/src/wiki/wiki_maintainer.js +38 -0
- package/dist/src/wiki/wiki_maintainer.js.map +1 -0
- package/dist/src/wiki/wiki_projector.d.ts +33 -0
- package/dist/src/wiki/wiki_projector.d.ts.map +1 -0
- package/dist/src/wiki/wiki_projector.js +633 -0
- package/dist/src/wiki/wiki_projector.js.map +1 -0
- package/dist/src/wiki/wiki_queue.d.ts +29 -0
- package/dist/src/wiki/wiki_queue.d.ts.map +1 -0
- package/dist/src/wiki/wiki_queue.js +137 -0
- package/dist/src/wiki/wiki_queue.js.map +1 -0
- package/openclaw.plugin.json +120 -4
- package/package.json +8 -4
- package/schema/graph.schema.yaml +188 -33
- package/skills/cortex-memory/SKILL.md +49 -0
- package/skills/cortex-memory/references/agent-manual.md +115 -0
- package/skills/cortex-memory/references/configuration.md +92 -0
- package/skills/cortex-memory/references/publish-checklist.md +46 -0
- package/skills/cortex-memory/references/system-prompt-template.md +27 -0
- package/skills/cortex-memory/references/tools.md +181 -0
- package/skills/cortex-memory/scripts/smoke-check.ps1 +56 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Cortex Memory Tool Reference
|
|
2
|
+
|
|
3
|
+
## Retrieval
|
|
4
|
+
|
|
5
|
+
### `search_memory`
|
|
6
|
+
|
|
7
|
+
Use for semantic recall of historical records.
|
|
8
|
+
|
|
9
|
+
Input:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"query": "What did we decide about memory decay?",
|
|
14
|
+
"top_k": 8
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### `query_graph`
|
|
19
|
+
|
|
20
|
+
Use for entity relationship lookup and path traversal.
|
|
21
|
+
|
|
22
|
+
Input:
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"entity": "memoryDecay",
|
|
27
|
+
"rel": "depends_on",
|
|
28
|
+
"dir": "both",
|
|
29
|
+
"path_to": "readFusion",
|
|
30
|
+
"max_depth": 3
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Typical response highlights:
|
|
35
|
+
- `edges[].fact_status` (`active/pending_conflict/superseded/rejected`)
|
|
36
|
+
- `wiki_refs`
|
|
37
|
+
- `evidence_ids`
|
|
38
|
+
- `conflict_hint` (when conflict facts are hit)
|
|
39
|
+
|
|
40
|
+
### `export_graph_view`
|
|
41
|
+
|
|
42
|
+
Use for status-aware graph snapshot export and wiki graph projection files.
|
|
43
|
+
|
|
44
|
+
Input:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"write_snapshot": true
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### `lint_memory_wiki`
|
|
53
|
+
|
|
54
|
+
Run wiki + graph consistency lint checks and return structured repair actions.
|
|
55
|
+
|
|
56
|
+
Input:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Conflict Governance
|
|
63
|
+
|
|
64
|
+
### `list_graph_conflicts`
|
|
65
|
+
|
|
66
|
+
List pending/handled conflicts that need confirmation.
|
|
67
|
+
|
|
68
|
+
Input:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"status": "pending",
|
|
73
|
+
"limit": 20
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### `resolve_graph_conflict`
|
|
78
|
+
|
|
79
|
+
Accept or reject a conflict candidate.
|
|
80
|
+
|
|
81
|
+
Input:
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"conflict_id": "gcf_xxx",
|
|
86
|
+
"action": "accept",
|
|
87
|
+
"note": "accepted with user confirmation"
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Persistence
|
|
92
|
+
|
|
93
|
+
### `store_event`
|
|
94
|
+
|
|
95
|
+
Persist durable decisions, outcomes, and entity relations.
|
|
96
|
+
|
|
97
|
+
Input:
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"summary": "Enabled strict graph quality mode for production.",
|
|
102
|
+
"entities": ["graphQualityMode", "production"],
|
|
103
|
+
"entity_types": {
|
|
104
|
+
"graphQualityMode": "config",
|
|
105
|
+
"production": "environment"
|
|
106
|
+
},
|
|
107
|
+
"outcome": "Reduced noisy relations in graph reads.",
|
|
108
|
+
"relations": [
|
|
109
|
+
{
|
|
110
|
+
"source": "graphQualityMode",
|
|
111
|
+
"target": "production",
|
|
112
|
+
"type": "applied_to",
|
|
113
|
+
"confidence": 0.92
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### `delete_memory`
|
|
120
|
+
|
|
121
|
+
Delete a specific record by id.
|
|
122
|
+
|
|
123
|
+
Input:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"memory_id": "mem_123"
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Session Context
|
|
132
|
+
|
|
133
|
+
### `get_hot_context`
|
|
134
|
+
|
|
135
|
+
Read currently hot records.
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"limit": 10
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### `get_auto_context`
|
|
144
|
+
|
|
145
|
+
Read auto-selected context from recent messages.
|
|
146
|
+
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"include_hot": true
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Maintenance
|
|
154
|
+
|
|
155
|
+
### `sync_memory`
|
|
156
|
+
|
|
157
|
+
Import historical session data into memory.
|
|
158
|
+
|
|
159
|
+
### `reflect_memory`
|
|
160
|
+
|
|
161
|
+
Promote events into reusable rules.
|
|
162
|
+
|
|
163
|
+
### `backfill_embeddings`
|
|
164
|
+
|
|
165
|
+
Repair or rebuild missing vectors.
|
|
166
|
+
|
|
167
|
+
Input:
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"layer": "all",
|
|
172
|
+
"batch_size": 64,
|
|
173
|
+
"max_retries": 3,
|
|
174
|
+
"retry_failed_only": false,
|
|
175
|
+
"rebuild_mode": "incremental"
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### `diagnostics`
|
|
180
|
+
|
|
181
|
+
Check model connectivity, registry status, and memory health.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[switch]$Json
|
|
3
|
+
)
|
|
4
|
+
|
|
5
|
+
$requiredEnv = @(
|
|
6
|
+
"EMBEDDING_API_KEY",
|
|
7
|
+
"LLM_API_KEY",
|
|
8
|
+
"RERANKER_API_KEY"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
$envStatus = @()
|
|
12
|
+
foreach ($name in $requiredEnv) {
|
|
13
|
+
$value = [Environment]::GetEnvironmentVariable($name)
|
|
14
|
+
$envStatus += [PSCustomObject]@{
|
|
15
|
+
name = $name
|
|
16
|
+
present = -not [string]::IsNullOrWhiteSpace($value)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
$defaultConfigPath = Join-Path $HOME ".openclaw/openclaw.json"
|
|
21
|
+
$configPath = if ($env:OPENCLAW_CONFIG_PATH) { $env:OPENCLAW_CONFIG_PATH } else { $defaultConfigPath }
|
|
22
|
+
$configExists = Test-Path -LiteralPath $configPath
|
|
23
|
+
|
|
24
|
+
$summary = [PSCustomObject]@{
|
|
25
|
+
checkedAt = (Get-Date).ToString("o")
|
|
26
|
+
configPath = $configPath
|
|
27
|
+
configExists = $configExists
|
|
28
|
+
env = $envStatus
|
|
29
|
+
allRequiredEnvPresent = (($envStatus | Where-Object { -not $_.present }).Count -eq 0)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if ($Json) {
|
|
33
|
+
$summary | ConvertTo-Json -Depth 6
|
|
34
|
+
exit 0
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Write-Host "Cortex Memory smoke check"
|
|
38
|
+
Write-Host "Config path: $($summary.configPath)"
|
|
39
|
+
Write-Host "Config exists: $($summary.configExists)"
|
|
40
|
+
Write-Host ""
|
|
41
|
+
Write-Host "Required environment variables:"
|
|
42
|
+
foreach ($item in $envStatus) {
|
|
43
|
+
$state = if ($item.present) { "OK" } else { "MISSING" }
|
|
44
|
+
Write-Host ("- {0}: {1}" -f $item.name, $state)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (-not $summary.allRequiredEnvPresent) {
|
|
48
|
+
Write-Host ""
|
|
49
|
+
Write-Host "One or more required environment variables are missing."
|
|
50
|
+
exit 1
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
Write-Host ""
|
|
54
|
+
Write-Host "All required environment variables are present."
|
|
55
|
+
exit 0
|
|
56
|
+
|