@gamaze/hicortex 0.15.3 → 0.16.1
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/README.md +3 -1
- package/dist/consolidate.d.ts +4 -3
- package/dist/consolidate.js +37 -13
- package/dist/db.js +83 -3
- package/dist/distiller.js +19 -12
- package/dist/eval/recall-sweep.d.ts +23 -0
- package/dist/eval/recall-sweep.js +288 -2
- package/dist/eval/relevance-eval.d.ts +64 -0
- package/dist/eval/relevance-eval.js +1954 -0
- package/dist/index.js +16 -6
- package/dist/init.d.ts +1 -1
- package/dist/init.js +53 -100
- package/dist/lessons-context.js +3 -2
- package/dist/llm.d.ts +3 -1
- package/dist/llm.js +18 -4
- package/dist/mcp-server.js +24 -19
- package/dist/memory-instructions.js +1 -1
- package/dist/prompts.js +22 -6
- package/dist/recall-hook-cli.d.ts +1 -1
- package/dist/recall-hook-cli.js +7 -2
- package/dist/recall-index.d.ts +76 -6
- package/dist/recall-index.js +101 -22
- package/dist/retrieval.d.ts +52 -1
- package/dist/retrieval.js +144 -23
- package/dist/seed-lesson.d.ts +1 -1
- package/dist/seed-lesson.js +1 -1
- package/dist/storage.d.ts +56 -3
- package/dist/storage.js +93 -17
- package/dist/types.d.ts +4 -0
- package/dist/uninstall.js +18 -4
- package/hermes-plugin/hicortex/client.py +8 -4
- package/hermes-plugin/hicortex/config.py +11 -0
- package/hermes-plugin/hicortex/provider.py +11 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -1
- package/skills/hicortex-activate/SKILL.md +0 -53
- package/skills/hicortex-learn/SKILL.md +0 -40
|
@@ -152,6 +152,7 @@ class HicortexProvider(MemoryProvider):
|
|
|
152
152
|
self._project: Optional[str] = None
|
|
153
153
|
self._recall_limit: int = 5
|
|
154
154
|
self._privacy: Optional[str] = "WORK,PERSONAL"
|
|
155
|
+
self._mission_domains: List[str] = [] # #203 scope (set from config in initialize)
|
|
155
156
|
self._agent_name: Optional[str] = None
|
|
156
157
|
self._prefetch_cache: Dict[str, str] = {}
|
|
157
158
|
self._bg_threads: List[threading.Thread] = []
|
|
@@ -208,6 +209,10 @@ class HicortexProvider(MemoryProvider):
|
|
|
208
209
|
except (TypeError, ValueError):
|
|
209
210
|
self._recall_limit = 5
|
|
210
211
|
self._privacy = cfg.get("privacy_filter", "WORK,PERSONAL")
|
|
212
|
+
# #203 scope: declared knowledge domains for this role-bound agent
|
|
213
|
+
# (e.g. Lenny → Health). Soft affinity boost on recall; never excludes.
|
|
214
|
+
_md_raw = cfg.get("mission_domains") or ""
|
|
215
|
+
self._mission_domains = [d.strip() for d in _md_raw.split(",") if d.strip()]
|
|
211
216
|
self._agent_name = _resolve_agent_name(cfg)
|
|
212
217
|
try:
|
|
213
218
|
self._client = self._build_client()
|
|
@@ -290,6 +295,7 @@ class HicortexProvider(MemoryProvider):
|
|
|
290
295
|
prompt=query,
|
|
291
296
|
project=self._project,
|
|
292
297
|
privacy=self._privacy,
|
|
298
|
+
mission_domains=self._mission_domains,
|
|
293
299
|
)
|
|
294
300
|
if status == 404:
|
|
295
301
|
# Old-server guard: pre-0.14 has no /recall-index. Latch
|
|
@@ -475,8 +481,11 @@ class HicortexProvider(MemoryProvider):
|
|
|
475
481
|
"Fetch ONE memory's full content by id — use this to lazy-load "
|
|
476
482
|
"entries from the recall index or from search results whose "
|
|
477
483
|
"snippet was not enough. Fetching a memory marks it as used "
|
|
478
|
-
"(strengthens it), so
|
|
479
|
-
"
|
|
484
|
+
"(strengthens it), so fetch entries that could change your "
|
|
485
|
+
"action — not every shown one. When the memory shapes your "
|
|
486
|
+
"answer, cite it as given in the response — mark a fetched "
|
|
487
|
+
"memory FETCHED and a one-line entry cited unread SNIPPET; "
|
|
488
|
+
"don't pass SNIPPET off as established."
|
|
480
489
|
),
|
|
481
490
|
"parameters": {
|
|
482
491
|
"type": "object",
|
package/openclaw.plugin.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"description": "Your agents remember past decisions, avoid repeated mistakes, and get smarter every day. Nightly reflection generates actionable lessons that automatically update agent behavior.",
|
|
5
5
|
"version": "0.10.0",
|
|
6
6
|
"kind": "lifecycle",
|
|
7
|
-
"skills": ["./skills/hicortex-memory"
|
|
7
|
+
"skills": ["./skills/hicortex-memory"],
|
|
8
8
|
"configSchema": {
|
|
9
9
|
"type": "object",
|
|
10
10
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamaze/hicortex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "Self-learning memory for AI agents — experience captured automatically, distilled into lessons overnight, shared across your whole fleet. Works with Hermes, OpenClaw, Claude Code, and Pi.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"test:watch": "vitest",
|
|
40
40
|
"eval": "node dist/eval/run-eval.js",
|
|
41
41
|
"eval:recall-sweep": "node dist/eval/recall-sweep.js",
|
|
42
|
+
"eval:relevance": "node dist/eval/relevance-eval.js",
|
|
42
43
|
"prepack": "npm run build && rm -rf ./hermes-plugin && mkdir -p ./hermes-plugin && cp -r ../../hermes-plugin/hicortex ./hermes-plugin/ && find ./hermes-plugin -name __pycache__ -type d -exec rm -rf {} + 2>/dev/null || true",
|
|
43
44
|
"prepublishOnly": "npm run build && rm -rf ./hermes-plugin && mkdir -p ./hermes-plugin && cp -r ../../hermes-plugin/hicortex ./hermes-plugin/ && find ./hermes-plugin -name __pycache__ -type d -exec rm -rf {} + 2>/dev/null || true"
|
|
44
45
|
},
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: hicortex-activate
|
|
3
|
-
description: Activate a Hicortex license key. Use when the user says they purchased Hicortex, has a license key, or wants to upgrade from the free tier.
|
|
4
|
-
version: 0.2.0
|
|
5
|
-
user-invocable: true
|
|
6
|
-
disable-model-invocation: false
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Activate Hicortex License
|
|
10
|
-
|
|
11
|
-
When the user wants to activate their license key, guide them through it.
|
|
12
|
-
|
|
13
|
-
## If they provide the key (e.g. `/hicortex-activate hctx-abc123`)
|
|
14
|
-
|
|
15
|
-
Run this command to apply the key:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
openclaw config set plugins.entries.hicortex.config.licenseKey "THE_KEY_HERE"
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Then restart the gateway:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
openclaw gateway restart
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Tell the user: "License activated! Hicortex now has unlimited memory. Your agent will keep learning and improving from every session."
|
|
28
|
-
|
|
29
|
-
## If they don't have a key yet
|
|
30
|
-
|
|
31
|
-
Tell them:
|
|
32
|
-
|
|
33
|
-
"You can get a license key at https://hicortex.gamaze.com/ — after purchase, you'll receive your key by email. Then come back and tell me the key, and I'll activate it for you."
|
|
34
|
-
|
|
35
|
-
## If activation fails
|
|
36
|
-
|
|
37
|
-
If the `openclaw config set` command fails, fall back to telling the user to manually add it:
|
|
38
|
-
|
|
39
|
-
"Open ~/.openclaw/openclaw.json, find the hicortex plugin entry, and add your key:
|
|
40
|
-
|
|
41
|
-
```json
|
|
42
|
-
"config": {
|
|
43
|
-
"licenseKey": "hctx-your-key-here"
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Then restart: `openclaw gateway restart`"
|
|
48
|
-
|
|
49
|
-
## Rules
|
|
50
|
-
|
|
51
|
-
- Never ask the user to open a terminal or edit files unless the automatic method fails
|
|
52
|
-
- Always confirm the key was applied by checking the gateway log after restart
|
|
53
|
-
- Be encouraging — they just bought the product
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: hicortex-learn
|
|
3
|
-
description: Save an explicit learning or insight to Hicortex long-term memory. Use when you discover something worth remembering across sessions — a lesson, a correction, a pattern, a decision.
|
|
4
|
-
version: 0.2.0
|
|
5
|
-
user-invocable: true
|
|
6
|
-
disable-model-invocation: false
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Save Learning to Hicortex
|
|
10
|
-
|
|
11
|
-
When invoked with `/learn <text>`, store the learning in long-term memory via hicortex_ingest.
|
|
12
|
-
|
|
13
|
-
## Steps
|
|
14
|
-
|
|
15
|
-
1. Parse the text after `/learn`
|
|
16
|
-
2. Clean it up into a clear, self-contained statement that will make sense months from now
|
|
17
|
-
3. Add today's date
|
|
18
|
-
4. Call the `hicortex_ingest` tool with:
|
|
19
|
-
- `content`: The learning text
|
|
20
|
-
- `project`: "global" (unless clearly project-specific)
|
|
21
|
-
- `memory_type`: "lesson"
|
|
22
|
-
|
|
23
|
-
## Example
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
/learn always check provider docs before assuming an API uses the same auth scheme as OpenAI
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Becomes:
|
|
30
|
-
```
|
|
31
|
-
hicortex_ingest(content="LEARNING: always check provider docs before assuming an API uses the same auth scheme as OpenAI — header names and token formats vary widely (Bearer vs x-api-key vs custom). (2026-04-07)", project="global", memory_type="lesson")
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Rules
|
|
35
|
-
|
|
36
|
-
- Keep it concise — one clear statement
|
|
37
|
-
- Include the "why" when relevant
|
|
38
|
-
- Include the date for temporal context
|
|
39
|
-
- Prefix with "LEARNING:" so it's identifiable in search
|
|
40
|
-
- Confirm to the user what was saved (title + confirmation)
|