@byte5ai/palaia 2.3.6 → 2.7.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 +5 -5
- package/index.ts +44 -19
- package/openclaw.plugin.json +3 -3
- package/package.json +3 -3
- package/skill/SKILL.md +408 -28
- package/src/config.ts +21 -1
- package/src/context-engine.ts +454 -298
- package/src/hooks/capture.ts +36 -22
- package/src/hooks/index.ts +115 -41
- package/src/hooks/recall.ts +74 -6
- package/src/hooks/session.ts +465 -0
- package/src/hooks/state.ts +106 -3
- package/src/priorities.ts +12 -0
- package/src/runner.ts +4 -4
- package/src/tools.ts +65 -23
- package/src/types.ts +409 -22
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# @byte5ai/palaia
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**palaia memory backend for OpenClaw.**
|
|
4
4
|
|
|
5
|
-
Replace OpenClaw's built-in `memory-core` with
|
|
5
|
+
Replace OpenClaw's built-in `memory-core` with palaia — local, cloud-free, WAL-backed agent memory with tier routing and semantic search.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
# Install
|
|
10
|
+
# Install palaia (Python CLI)
|
|
11
11
|
pip install palaia
|
|
12
12
|
|
|
13
13
|
# Install the OpenClaw plugin
|
|
@@ -59,7 +59,7 @@ All options are optional — sensible defaults are used:
|
|
|
59
59
|
|
|
60
60
|
### `memory_search` (always available)
|
|
61
61
|
|
|
62
|
-
Semantically search
|
|
62
|
+
Semantically search palaia memory:
|
|
63
63
|
|
|
64
64
|
```
|
|
65
65
|
memory_search({ query: "deployment process", maxResults: 5, tier: "all" })
|
|
@@ -122,7 +122,7 @@ OpenClaw Agent
|
|
|
122
122
|
|
|
123
123
|
```bash
|
|
124
124
|
# Clone the repo
|
|
125
|
-
git clone https://github.com/
|
|
125
|
+
git clone https://github.com/byte5ai/palaia.git
|
|
126
126
|
cd palaia/packages/openclaw-plugin
|
|
127
127
|
|
|
128
128
|
# Install deps
|
package/index.ts
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @byte5ai/palaia —
|
|
2
|
+
* @byte5ai/palaia — palaia Memory Backend for OpenClaw
|
|
3
3
|
*
|
|
4
4
|
* Plugin entry point. Loaded by OpenClaw via jiti (no build step needed).
|
|
5
5
|
*
|
|
6
6
|
* Registers:
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
9
|
-
* -
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
12
|
-
*
|
|
7
|
+
* - Tools: memory_search, memory_get, memory_write
|
|
8
|
+
* - MemoryPromptSection: Guided tool usage hints
|
|
9
|
+
* - Session hooks (always): session_start, session_end, before_reset,
|
|
10
|
+
* llm_input, llm_output, after_tool_call, subagent_spawning, subagent_ended
|
|
11
|
+
* - ContextEngine (modern) OR legacy hooks (before_prompt_build, agent_end,
|
|
12
|
+
* message_received, message_sending)
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* v3.0 Features:
|
|
15
|
+
* - Session continuity: Auto-briefing on session start / LLM switch
|
|
16
|
+
* - Session summaries: Auto-saved on session end / reset
|
|
17
|
+
* - Tool observations: Tracked via after_tool_call
|
|
18
|
+
* - Progressive disclosure: Compact mode for large memory stores
|
|
19
|
+
* - Privacy markers: <private> blocks excluded from capture
|
|
20
|
+
* - Recency boost: Fresh memories ranked higher
|
|
17
21
|
*
|
|
18
22
|
* Activation:
|
|
19
23
|
* plugins: { slots: { memory: "palaia" } }
|
|
@@ -22,21 +26,20 @@
|
|
|
22
26
|
import { resolveConfig, type PalaiaPluginConfig } from "./src/config.js";
|
|
23
27
|
import { registerTools } from "./src/tools.js";
|
|
24
28
|
import { registerHooks } from "./src/hooks/index.js";
|
|
29
|
+
import { registerSessionHooks } from "./src/hooks/session.js";
|
|
25
30
|
import { createPalaiaContextEngine } from "./src/context-engine.js";
|
|
26
31
|
import type { OpenClawPluginApi, OpenClawPluginEntry } from "./src/types.js";
|
|
27
32
|
|
|
28
33
|
// Plugin entry point compatible with OpenClaw plugin-sdk definePluginEntry
|
|
29
34
|
const palaiaPlugin: OpenClawPluginEntry = {
|
|
30
35
|
id: "palaia",
|
|
31
|
-
name: "
|
|
32
|
-
|
|
33
|
-
// Issue #66: Plugin config is
|
|
36
|
+
name: "palaia Memory",
|
|
37
|
+
register(api: OpenClawPluginApi) {
|
|
38
|
+
// Issue #66: Plugin config is resolved GLOBALLY via api.pluginConfig.
|
|
34
39
|
// OpenClaw does NOT provide per-agent config resolution — all agents share the same
|
|
35
|
-
// plugin config from openclaw.json → plugins.
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
// See: https://github.com/iret77/palaia/issues/66
|
|
39
|
-
const rawConfig = api.getConfig?.("palaia") as
|
|
40
|
+
// plugin config from openclaw.json → plugins.entries.palaia.config.
|
|
41
|
+
// See: https://github.com/byte5ai/palaia/issues/66
|
|
42
|
+
const rawConfig = api.pluginConfig as
|
|
40
43
|
| Partial<PalaiaPluginConfig>
|
|
41
44
|
| undefined;
|
|
42
45
|
const config = resolveConfig(rawConfig);
|
|
@@ -51,9 +54,31 @@ const palaiaPlugin: OpenClawPluginEntry = {
|
|
|
51
54
|
// Register agent tools (memory_search, memory_get, memory_write)
|
|
52
55
|
registerTools(api, config);
|
|
53
56
|
|
|
57
|
+
// Register MemoryPromptSection for guided memory tool usage (v3.0)
|
|
58
|
+
if (api.registerMemoryPromptSection) {
|
|
59
|
+
api.registerMemoryPromptSection(({ availableTools }) => {
|
|
60
|
+
const lines: string[] = [];
|
|
61
|
+
if (availableTools.has("memory_search")) {
|
|
62
|
+
lines.push("Use `memory_search` to find relevant memories by semantic query.");
|
|
63
|
+
}
|
|
64
|
+
if (availableTools.has("memory_get")) {
|
|
65
|
+
lines.push("Use `memory_get <id>` to retrieve full memory details by ID.");
|
|
66
|
+
}
|
|
67
|
+
if (availableTools.has("memory_write")) {
|
|
68
|
+
lines.push("Use `memory_write` for processes/SOPs and tasks only — conversation knowledge is auto-captured.");
|
|
69
|
+
}
|
|
70
|
+
return lines;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Session lifecycle hooks are always registered (session_start, session_end,
|
|
75
|
+
// before_reset, llm_input, llm_output, after_tool_call).
|
|
76
|
+
// These work independently of the ContextEngine vs legacy hooks choice.
|
|
77
|
+
registerSessionHooks(api, config);
|
|
78
|
+
|
|
54
79
|
// Register ContextEngine when available, otherwise use legacy hooks
|
|
55
80
|
if (api.registerContextEngine) {
|
|
56
|
-
api.registerContextEngine("palaia", createPalaiaContextEngine(api, config));
|
|
81
|
+
api.registerContextEngine("palaia", () => createPalaiaContextEngine(api, config));
|
|
57
82
|
} else {
|
|
58
83
|
registerHooks(api, config); // Legacy fallback
|
|
59
84
|
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "palaia",
|
|
3
|
-
"name": "
|
|
3
|
+
"name": "palaia Memory",
|
|
4
4
|
"kind": "memory",
|
|
5
5
|
"skills": ["./skill"],
|
|
6
6
|
"configSchema": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"workspace": {
|
|
14
14
|
"type": "string",
|
|
15
|
-
"description": "
|
|
15
|
+
"description": "palaia workspace path (default: agent workspace)"
|
|
16
16
|
},
|
|
17
17
|
"tier": {
|
|
18
18
|
"type": "string",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
},
|
|
107
107
|
"uiHints": {
|
|
108
108
|
"binaryPath": {
|
|
109
|
-
"label": "
|
|
109
|
+
"label": "palaia Binary Path",
|
|
110
110
|
"placeholder": "auto-detect"
|
|
111
111
|
},
|
|
112
112
|
"workspace": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byte5ai/palaia",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.7.1",
|
|
4
|
+
"description": "palaia memory backend for OpenClaw",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"openclaw": {
|
|
7
7
|
"extensions": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
|
-
"url": "https://github.com/
|
|
28
|
+
"url": "https://github.com/byte5ai/palaia.git",
|
|
29
29
|
"directory": "packages/openclaw-plugin"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|