omnimem 0.1.0
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 +89 -0
- package/bin/omnimem +5 -0
- package/db/schema.sql +78 -0
- package/docs/quickstart-10min.md +35 -0
- package/omnimem/__init__.py +2 -0
- package/omnimem/adapters.py +123 -0
- package/omnimem/cli.py +579 -0
- package/omnimem/core.py +826 -0
- package/omnimem/webui.py +602 -0
- package/package.json +37 -0
- package/scripts/attach_project.sh +25 -0
- package/scripts/bootstrap.sh +77 -0
- package/scripts/detach_project.sh +21 -0
- package/scripts/install.sh +94 -0
- package/scripts/uninstall.sh +13 -0
- package/scripts/verify_phase_a.sh +52 -0
- package/scripts/verify_phase_b.sh +21 -0
- package/scripts/verify_phase_c.sh +19 -0
- package/scripts/verify_phase_d.sh +28 -0
- package/spec/changelog.md +14 -0
- package/spec/memory-envelope.schema.json +111 -0
- package/spec/memory-event.schema.json +31 -0
- package/spec/protocol.md +77 -0
- package/templates/project-minimal/.omnimem-ignore +8 -0
- package/templates/project-minimal/.omnimem-session.md +13 -0
- package/templates/project-minimal/.omnimem.json +10 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
if [[ $# -lt 2 ]]; then
|
|
5
|
+
echo "Usage: bash scripts/attach_project.sh <project_path> <project_id>"
|
|
6
|
+
exit 1
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
|
+
PROJECT_PATH="$1"
|
|
11
|
+
PROJECT_ID="$2"
|
|
12
|
+
|
|
13
|
+
if [[ ! -d "$PROJECT_PATH" ]]; then
|
|
14
|
+
echo "Project path not found: $PROJECT_PATH"
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
cp -f "$ROOT_DIR/templates/project-minimal/.omnimem.json" "$PROJECT_PATH/.omnimem.json"
|
|
19
|
+
cp -f "$ROOT_DIR/templates/project-minimal/.omnimem-session.md" "$PROJECT_PATH/.omnimem-session.md"
|
|
20
|
+
cp -f "$ROOT_DIR/templates/project-minimal/.omnimem-ignore" "$PROJECT_PATH/.omnimem-ignore"
|
|
21
|
+
|
|
22
|
+
sed -i.bak "s/replace-with-project-id/$PROJECT_ID/g" "$PROJECT_PATH/.omnimem.json"
|
|
23
|
+
rm -f "$PROJECT_PATH/.omnimem.json.bak"
|
|
24
|
+
|
|
25
|
+
echo "Attached OmniMem to: $PROJECT_PATH (project_id=$PROJECT_ID)"
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# One-command bootstrap for new device / new account.
|
|
5
|
+
# Example:
|
|
6
|
+
# bash scripts/bootstrap.sh --repo git@github.com:YOUR_USER/omnimem.git
|
|
7
|
+
# bash scripts/bootstrap.sh --repo https://github.com/YOUR_USER/omnimem.git --attach ~/code/myproj --project-id myproj
|
|
8
|
+
|
|
9
|
+
TARGET_HOME="${OMNIMEM_HOME:-$HOME/.omnimem}"
|
|
10
|
+
APP_DIR="$TARGET_HOME/app"
|
|
11
|
+
REPO_URL=""
|
|
12
|
+
BRANCH="main"
|
|
13
|
+
REMOTE_NAME="origin"
|
|
14
|
+
REMOTE_URL=""
|
|
15
|
+
ATTACH_PATH=""
|
|
16
|
+
PROJECT_ID=""
|
|
17
|
+
|
|
18
|
+
while [[ $# -gt 0 ]]; do
|
|
19
|
+
case "$1" in
|
|
20
|
+
--repo)
|
|
21
|
+
REPO_URL="$2"
|
|
22
|
+
shift 2
|
|
23
|
+
;;
|
|
24
|
+
--branch)
|
|
25
|
+
BRANCH="$2"
|
|
26
|
+
shift 2
|
|
27
|
+
;;
|
|
28
|
+
--remote-name)
|
|
29
|
+
REMOTE_NAME="$2"
|
|
30
|
+
shift 2
|
|
31
|
+
;;
|
|
32
|
+
--remote-url)
|
|
33
|
+
REMOTE_URL="$2"
|
|
34
|
+
shift 2
|
|
35
|
+
;;
|
|
36
|
+
--attach)
|
|
37
|
+
ATTACH_PATH="$2"
|
|
38
|
+
shift 2
|
|
39
|
+
;;
|
|
40
|
+
--project-id)
|
|
41
|
+
PROJECT_ID="$2"
|
|
42
|
+
shift 2
|
|
43
|
+
;;
|
|
44
|
+
*)
|
|
45
|
+
echo "Unknown arg: $1"
|
|
46
|
+
exit 1
|
|
47
|
+
;;
|
|
48
|
+
esac
|
|
49
|
+
done
|
|
50
|
+
|
|
51
|
+
if [[ -z "$REPO_URL" ]]; then
|
|
52
|
+
echo "Usage: bash scripts/bootstrap.sh --repo <git_repo_url> [--branch main] [--remote-url <memory_git_url>] [--attach <project_path> --project-id <id>]"
|
|
53
|
+
exit 1
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
mkdir -p "$TARGET_HOME"
|
|
57
|
+
|
|
58
|
+
if [[ -d "$APP_DIR/.git" ]]; then
|
|
59
|
+
git -C "$APP_DIR" fetch --all --prune
|
|
60
|
+
git -C "$APP_DIR" checkout "$BRANCH"
|
|
61
|
+
git -C "$APP_DIR" pull --rebase
|
|
62
|
+
else
|
|
63
|
+
git clone --branch "$BRANCH" "$REPO_URL" "$APP_DIR"
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
cd "$APP_DIR"
|
|
67
|
+
bash scripts/install.sh --remote-name "$REMOTE_NAME" --branch "$BRANCH" ${REMOTE_URL:+--remote-url "$REMOTE_URL"}
|
|
68
|
+
|
|
69
|
+
if [[ -n "$ATTACH_PATH" ]]; then
|
|
70
|
+
if [[ -z "$PROJECT_ID" ]]; then
|
|
71
|
+
PROJECT_ID="$(basename "$ATTACH_PATH")"
|
|
72
|
+
fi
|
|
73
|
+
bash scripts/attach_project.sh "$ATTACH_PATH" "$PROJECT_ID"
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
echo "Bootstrap done."
|
|
77
|
+
echo "Run: $TARGET_HOME/bin/omnimem start --host 127.0.0.1 --port 8765"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
if [[ $# -lt 1 ]]; then
|
|
5
|
+
echo "Usage: bash scripts/detach_project.sh <project_path>"
|
|
6
|
+
exit 1
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
PROJECT_PATH="$1"
|
|
10
|
+
|
|
11
|
+
if [[ ! -d "$PROJECT_PATH" ]]; then
|
|
12
|
+
echo "Project path not found: $PROJECT_PATH"
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
rm -f "$PROJECT_PATH/.omnimem.json" \
|
|
17
|
+
"$PROJECT_PATH/.omnimem-session.md" \
|
|
18
|
+
"$PROJECT_PATH/.omnimem-ignore" \
|
|
19
|
+
"$PROJECT_PATH/.omnimem-hooks.sh"
|
|
20
|
+
|
|
21
|
+
echo "Detached OmniMem from: $PROJECT_PATH"
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
TARGET_HOME="${OMNIMEM_HOME:-$HOME/.omnimem}"
|
|
6
|
+
|
|
7
|
+
WIZARD=0
|
|
8
|
+
REMOTE_NAME="origin"
|
|
9
|
+
BRANCH="main"
|
|
10
|
+
REMOTE_URL=""
|
|
11
|
+
|
|
12
|
+
while [[ $# -gt 0 ]]; do
|
|
13
|
+
case "$1" in
|
|
14
|
+
--wizard)
|
|
15
|
+
WIZARD=1
|
|
16
|
+
shift
|
|
17
|
+
;;
|
|
18
|
+
--remote-name)
|
|
19
|
+
REMOTE_NAME="$2"
|
|
20
|
+
shift 2
|
|
21
|
+
;;
|
|
22
|
+
--branch)
|
|
23
|
+
BRANCH="$2"
|
|
24
|
+
shift 2
|
|
25
|
+
;;
|
|
26
|
+
--remote-url)
|
|
27
|
+
REMOTE_URL="$2"
|
|
28
|
+
shift 2
|
|
29
|
+
;;
|
|
30
|
+
*)
|
|
31
|
+
echo "Unknown arg: $1"
|
|
32
|
+
exit 1
|
|
33
|
+
;;
|
|
34
|
+
esac
|
|
35
|
+
done
|
|
36
|
+
|
|
37
|
+
if [[ "$WIZARD" -eq 1 ]]; then
|
|
38
|
+
echo "[OmniMem Install Wizard]"
|
|
39
|
+
read -r -p "Install home [$TARGET_HOME]: " input_home
|
|
40
|
+
TARGET_HOME="${input_home:-$TARGET_HOME}"
|
|
41
|
+
|
|
42
|
+
read -r -p "Git remote name [$REMOTE_NAME]: " input_remote_name
|
|
43
|
+
REMOTE_NAME="${input_remote_name:-$REMOTE_NAME}"
|
|
44
|
+
|
|
45
|
+
read -r -p "Git branch [$BRANCH]: " input_branch
|
|
46
|
+
BRANCH="${input_branch:-$BRANCH}"
|
|
47
|
+
|
|
48
|
+
read -r -p "Git remote url (optional, e.g. git@github.com:user/repo.git): " input_remote_url
|
|
49
|
+
REMOTE_URL="${input_remote_url:-$REMOTE_URL}"
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
mkdir -p "$TARGET_HOME"
|
|
53
|
+
mkdir -p "$TARGET_HOME/data/markdown"/{instant,short,long,archive}
|
|
54
|
+
mkdir -p "$TARGET_HOME/data/jsonl"
|
|
55
|
+
mkdir -p "$TARGET_HOME/spec" "$TARGET_HOME/db" "$TARGET_HOME/docs"
|
|
56
|
+
mkdir -p "$TARGET_HOME/bin" "$TARGET_HOME/lib"
|
|
57
|
+
|
|
58
|
+
cp -f "$ROOT_DIR/spec/"*.json "$TARGET_HOME/spec/"
|
|
59
|
+
cp -f "$ROOT_DIR/db/schema.sql" "$TARGET_HOME/db/schema.sql"
|
|
60
|
+
cp -f "$ROOT_DIR/docs/architecture.md" "$TARGET_HOME/docs/architecture.md"
|
|
61
|
+
rm -rf "$TARGET_HOME/lib/omnimem"
|
|
62
|
+
cp -R "$ROOT_DIR/omnimem" "$TARGET_HOME/lib/omnimem"
|
|
63
|
+
|
|
64
|
+
cat > "$TARGET_HOME/bin/omnimem" <<SH
|
|
65
|
+
#!/usr/bin/env bash
|
|
66
|
+
set -euo pipefail
|
|
67
|
+
export OMNIMEM_HOME="$TARGET_HOME"
|
|
68
|
+
PYTHONPATH="$TARGET_HOME/lib\${PYTHONPATH:+:\$PYTHONPATH}" exec python3 -m omnimem.cli "\$@"
|
|
69
|
+
SH
|
|
70
|
+
chmod +x "$TARGET_HOME/bin/omnimem"
|
|
71
|
+
|
|
72
|
+
cat > "$TARGET_HOME/omnimem.config.json" <<JSON
|
|
73
|
+
{
|
|
74
|
+
"version": "0.1.0",
|
|
75
|
+
"home": "$TARGET_HOME",
|
|
76
|
+
"storage": {
|
|
77
|
+
"markdown": "$TARGET_HOME/data/markdown",
|
|
78
|
+
"jsonl": "$TARGET_HOME/data/jsonl",
|
|
79
|
+
"sqlite": "$TARGET_HOME/data/omnimem.db"
|
|
80
|
+
},
|
|
81
|
+
"sync": {
|
|
82
|
+
"github": {
|
|
83
|
+
"remote_name": "$REMOTE_NAME",
|
|
84
|
+
"remote_url": "$REMOTE_URL",
|
|
85
|
+
"branch": "$BRANCH"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
JSON
|
|
90
|
+
|
|
91
|
+
echo "Installed OmniMem skeleton at: $TARGET_HOME"
|
|
92
|
+
echo "CLI path: $TARGET_HOME/bin/omnimem"
|
|
93
|
+
echo "Config path: $TARGET_HOME/omnimem.config.json"
|
|
94
|
+
echo "Start App: $TARGET_HOME/bin/omnimem start --host 127.0.0.1 --port 8765"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
TARGET_HOME="${OMNIMEM_HOME:-$HOME/.omnimem}"
|
|
5
|
+
CONFIG_FILE="$TARGET_HOME/omnimem.config.json"
|
|
6
|
+
|
|
7
|
+
if [[ ! -f "$CONFIG_FILE" ]]; then
|
|
8
|
+
echo "No OmniMem install found at: $TARGET_HOME"
|
|
9
|
+
exit 0
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
rm -rf "$TARGET_HOME"
|
|
13
|
+
echo "Removed OmniMem install at: $TARGET_HOME"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
|
|
6
|
+
required_files=(
|
|
7
|
+
"README.md"
|
|
8
|
+
"docs/architecture.md"
|
|
9
|
+
"docs/decisions.md"
|
|
10
|
+
"docs/integration-spec.md"
|
|
11
|
+
"docs/sync-and-adapters.md"
|
|
12
|
+
"docs/phase-workflow.md"
|
|
13
|
+
"docs/install-uninstall.md"
|
|
14
|
+
"docs/webui-plan.md"
|
|
15
|
+
"spec/protocol.md"
|
|
16
|
+
"spec/memory-envelope.schema.json"
|
|
17
|
+
"spec/memory-event.schema.json"
|
|
18
|
+
"db/schema.sql"
|
|
19
|
+
"scripts/install.sh"
|
|
20
|
+
"scripts/uninstall.sh"
|
|
21
|
+
"scripts/attach_project.sh"
|
|
22
|
+
"scripts/detach_project.sh"
|
|
23
|
+
"templates/project-minimal/.omnimem.json"
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
missing=0
|
|
27
|
+
for f in "${required_files[@]}"; do
|
|
28
|
+
if [[ ! -f "$ROOT_DIR/$f" ]]; then
|
|
29
|
+
echo "[FAIL] missing $f"
|
|
30
|
+
missing=1
|
|
31
|
+
fi
|
|
32
|
+
done
|
|
33
|
+
|
|
34
|
+
if [[ $missing -ne 0 ]]; then
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
echo "[OK] required files present"
|
|
39
|
+
|
|
40
|
+
if command -v sqlite3 >/dev/null 2>&1; then
|
|
41
|
+
tmpdb="$(mktemp "${TMPDIR:-/tmp}/omnimem.verify.XXXXXX.db")"
|
|
42
|
+
sqlite3 "$tmpdb" < "$ROOT_DIR/db/schema.sql"
|
|
43
|
+
table_count="$(sqlite3 "$tmpdb" "SELECT count(*) FROM sqlite_master WHERE type IN ('table','view');")"
|
|
44
|
+
signal_col_count="$(sqlite3 "$tmpdb" "SELECT count(*) FROM pragma_table_info('memories') WHERE name IN ('importance_score','confidence_score','stability_score','reuse_count','volatility_score');")"
|
|
45
|
+
rm -f "$tmpdb"
|
|
46
|
+
echo "[OK] sqlite schema applies, table/view count=$table_count"
|
|
47
|
+
echo "[OK] memory signals columns count=$signal_col_count"
|
|
48
|
+
else
|
|
49
|
+
echo "[WARN] sqlite3 not found; schema apply check skipped"
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
echo "[OK] Phase A verification completed"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
|
|
6
|
+
required_files=(
|
|
7
|
+
"omnimem/cli.py"
|
|
8
|
+
"omnimem/core.py"
|
|
9
|
+
"bin/omnimem"
|
|
10
|
+
"tests/test_cli_mvp.sh"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
for f in "${required_files[@]}"; do
|
|
14
|
+
[[ -f "$ROOT_DIR/$f" ]] || { echo "[FAIL] missing $f"; exit 1; }
|
|
15
|
+
done
|
|
16
|
+
|
|
17
|
+
echo "[OK] phase-b files present"
|
|
18
|
+
|
|
19
|
+
bash "$ROOT_DIR/tests/test_cli_mvp.sh"
|
|
20
|
+
|
|
21
|
+
echo "[OK] Phase B verification completed"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
|
|
6
|
+
required_files=(
|
|
7
|
+
"omnimem/adapters.py"
|
|
8
|
+
"tests/test_phase_c_adapters.sh"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
for f in "${required_files[@]}"; do
|
|
12
|
+
[[ -f "$ROOT_DIR/$f" ]] || { echo "[FAIL] missing $f"; exit 1; }
|
|
13
|
+
done
|
|
14
|
+
|
|
15
|
+
echo "[OK] phase-c files present"
|
|
16
|
+
|
|
17
|
+
bash "$ROOT_DIR/tests/test_phase_c_adapters.sh"
|
|
18
|
+
|
|
19
|
+
echo "[OK] Phase C verification completed"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
|
|
6
|
+
required_files=(
|
|
7
|
+
"omnimem/webui.py"
|
|
8
|
+
"tests/test_phase_d_webui.sh"
|
|
9
|
+
"scripts/bootstrap.sh"
|
|
10
|
+
"tests/test_bootstrap.sh"
|
|
11
|
+
"tests/test_bootstrap_cli_cmd.sh"
|
|
12
|
+
"tests/test_uninstall_cli.sh"
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
for f in "${required_files[@]}"; do
|
|
16
|
+
[[ -f "$ROOT_DIR/$f" ]] || { echo "[FAIL] missing $f"; exit 1; }
|
|
17
|
+
done
|
|
18
|
+
|
|
19
|
+
echo "[OK] phase-d files present"
|
|
20
|
+
|
|
21
|
+
python3 -m py_compile "$ROOT_DIR/omnimem/webui.py"
|
|
22
|
+
|
|
23
|
+
bash "$ROOT_DIR/tests/test_phase_d_webui.sh"
|
|
24
|
+
bash "$ROOT_DIR/tests/test_bootstrap.sh"
|
|
25
|
+
bash "$ROOT_DIR/tests/test_bootstrap_cli_cmd.sh"
|
|
26
|
+
bash "$ROOT_DIR/tests/test_uninstall_cli.sh"
|
|
27
|
+
|
|
28
|
+
echo "[OK] Phase D verification completed"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Schema Changelog
|
|
2
|
+
|
|
3
|
+
## v0.1.0 (2026-02-08)
|
|
4
|
+
|
|
5
|
+
- Initial `MemoryEnvelope` and `MemoryEvent` schemas.
|
|
6
|
+
- Layered memory model and event taxonomy.
|
|
7
|
+
- Credential reference constraints (no plaintext secrets).
|
|
8
|
+
- Added `signals` fields:
|
|
9
|
+
- `importance_score`
|
|
10
|
+
- `confidence_score`
|
|
11
|
+
- `stability_score`
|
|
12
|
+
- `reuse_count`
|
|
13
|
+
- `volatility_score`
|
|
14
|
+
- Added corresponding signal columns and indexes in SQLite `memories` table.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://omnimem.dev/schema/memory-envelope.schema.json",
|
|
4
|
+
"title": "MemoryEnvelope",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"id",
|
|
8
|
+
"schema_version",
|
|
9
|
+
"created_at",
|
|
10
|
+
"updated_at",
|
|
11
|
+
"layer",
|
|
12
|
+
"kind",
|
|
13
|
+
"summary",
|
|
14
|
+
"body_md_path",
|
|
15
|
+
"tags",
|
|
16
|
+
"refs",
|
|
17
|
+
"signals",
|
|
18
|
+
"cred_refs",
|
|
19
|
+
"source",
|
|
20
|
+
"scope",
|
|
21
|
+
"integrity"
|
|
22
|
+
],
|
|
23
|
+
"properties": {
|
|
24
|
+
"id": { "type": "string", "minLength": 8 },
|
|
25
|
+
"schema_version": { "type": "string" },
|
|
26
|
+
"created_at": { "type": "string", "format": "date-time" },
|
|
27
|
+
"updated_at": { "type": "string", "format": "date-time" },
|
|
28
|
+
"layer": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"enum": ["instant", "short", "long", "archive"]
|
|
31
|
+
},
|
|
32
|
+
"kind": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"enum": ["note", "decision", "task", "checkpoint", "summary", "evidence"]
|
|
35
|
+
},
|
|
36
|
+
"summary": { "type": "string", "minLength": 1 },
|
|
37
|
+
"body_md_path": { "type": "string", "minLength": 1 },
|
|
38
|
+
"tags": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"items": { "type": "string" },
|
|
41
|
+
"default": []
|
|
42
|
+
},
|
|
43
|
+
"refs": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"required": ["type", "target"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"type": { "type": "string", "enum": ["memory", "file", "url", "notion", "r2"] },
|
|
50
|
+
"target": { "type": "string" },
|
|
51
|
+
"note": { "type": "string" }
|
|
52
|
+
},
|
|
53
|
+
"additionalProperties": false
|
|
54
|
+
},
|
|
55
|
+
"default": []
|
|
56
|
+
},
|
|
57
|
+
"signals": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"required": [
|
|
60
|
+
"importance_score",
|
|
61
|
+
"confidence_score",
|
|
62
|
+
"stability_score",
|
|
63
|
+
"reuse_count",
|
|
64
|
+
"volatility_score"
|
|
65
|
+
],
|
|
66
|
+
"properties": {
|
|
67
|
+
"importance_score": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
68
|
+
"confidence_score": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
69
|
+
"stability_score": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
70
|
+
"reuse_count": { "type": "integer", "minimum": 0 },
|
|
71
|
+
"volatility_score": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
72
|
+
},
|
|
73
|
+
"additionalProperties": false
|
|
74
|
+
},
|
|
75
|
+
"cred_refs": {
|
|
76
|
+
"type": "array",
|
|
77
|
+
"items": { "type": "string", "pattern": "^(op|env|aws-sm|gcp-sm)://.+" },
|
|
78
|
+
"default": []
|
|
79
|
+
},
|
|
80
|
+
"source": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"required": ["tool", "session_id"],
|
|
83
|
+
"properties": {
|
|
84
|
+
"tool": { "type": "string" },
|
|
85
|
+
"account": { "type": "string" },
|
|
86
|
+
"device": { "type": "string" },
|
|
87
|
+
"session_id": { "type": "string" }
|
|
88
|
+
},
|
|
89
|
+
"additionalProperties": false
|
|
90
|
+
},
|
|
91
|
+
"scope": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"required": ["project_id"],
|
|
94
|
+
"properties": {
|
|
95
|
+
"project_id": { "type": "string" },
|
|
96
|
+
"workspace": { "type": "string" }
|
|
97
|
+
},
|
|
98
|
+
"additionalProperties": false
|
|
99
|
+
},
|
|
100
|
+
"integrity": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"required": ["content_sha256", "envelope_version"],
|
|
103
|
+
"properties": {
|
|
104
|
+
"content_sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
105
|
+
"envelope_version": { "type": "integer", "minimum": 1 }
|
|
106
|
+
},
|
|
107
|
+
"additionalProperties": false
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"additionalProperties": false
|
|
111
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://omnimem.dev/schema/memory-event.schema.json",
|
|
4
|
+
"title": "MemoryEvent",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"event_id",
|
|
8
|
+
"event_type",
|
|
9
|
+
"event_time",
|
|
10
|
+
"memory_id",
|
|
11
|
+
"payload"
|
|
12
|
+
],
|
|
13
|
+
"properties": {
|
|
14
|
+
"event_id": { "type": "string", "minLength": 8 },
|
|
15
|
+
"event_type": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"enum": [
|
|
18
|
+
"memory.write",
|
|
19
|
+
"memory.update",
|
|
20
|
+
"memory.checkpoint",
|
|
21
|
+
"memory.promote",
|
|
22
|
+
"memory.verify",
|
|
23
|
+
"memory.sync"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"event_time": { "type": "string", "format": "date-time" },
|
|
27
|
+
"memory_id": { "type": "string", "minLength": 8 },
|
|
28
|
+
"payload": { "type": "object" }
|
|
29
|
+
},
|
|
30
|
+
"additionalProperties": false
|
|
31
|
+
}
|
package/spec/protocol.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# OmniMem Protocol v0.1.0
|
|
2
|
+
|
|
3
|
+
## 1. Versioning
|
|
4
|
+
|
|
5
|
+
- Protocol version: `0.1.0`
|
|
6
|
+
- Semantic versioning rules:
|
|
7
|
+
- `MAJOR`: breaking model changes
|
|
8
|
+
- `MINOR`: backward-compatible additions
|
|
9
|
+
- `PATCH`: fixes and clarifications
|
|
10
|
+
|
|
11
|
+
## 2. Memory Envelope
|
|
12
|
+
|
|
13
|
+
Required fields:
|
|
14
|
+
|
|
15
|
+
- `id`
|
|
16
|
+
- `schema_version`
|
|
17
|
+
- `created_at`
|
|
18
|
+
- `updated_at`
|
|
19
|
+
- `layer` (`instant|short|long|archive`)
|
|
20
|
+
- `kind` (`note|decision|task|checkpoint|summary|evidence`)
|
|
21
|
+
- `summary`
|
|
22
|
+
- `body_md_path`
|
|
23
|
+
- `tags`
|
|
24
|
+
- `refs`
|
|
25
|
+
- `signals`
|
|
26
|
+
- `cred_refs`
|
|
27
|
+
- `source`
|
|
28
|
+
- `scope`
|
|
29
|
+
- `integrity`
|
|
30
|
+
|
|
31
|
+
`signals` fields:
|
|
32
|
+
|
|
33
|
+
- `importance_score` [0,1]
|
|
34
|
+
- `confidence_score` [0,1]
|
|
35
|
+
- `stability_score` [0,1]
|
|
36
|
+
- `reuse_count` >= 0
|
|
37
|
+
- `volatility_score` [0,1]
|
|
38
|
+
|
|
39
|
+
Constraints:
|
|
40
|
+
|
|
41
|
+
- `cred_refs` must never contain plaintext secrets.
|
|
42
|
+
- `body_md_path` must be repo-relative.
|
|
43
|
+
- `integrity.content_sha256` must match markdown body hash.
|
|
44
|
+
|
|
45
|
+
## 3. JSONL Event Model
|
|
46
|
+
|
|
47
|
+
One event per line. Event types:
|
|
48
|
+
|
|
49
|
+
- `memory.write`
|
|
50
|
+
- `memory.update`
|
|
51
|
+
- `memory.checkpoint`
|
|
52
|
+
- `memory.promote`
|
|
53
|
+
- `memory.verify`
|
|
54
|
+
- `memory.sync`
|
|
55
|
+
|
|
56
|
+
Required fields:
|
|
57
|
+
|
|
58
|
+
- `event_id`
|
|
59
|
+
- `event_type`
|
|
60
|
+
- `event_time`
|
|
61
|
+
- `memory_id`
|
|
62
|
+
- `payload`
|
|
63
|
+
|
|
64
|
+
## 4. SQLite Model
|
|
65
|
+
|
|
66
|
+
- `memories`: envelope metadata and signals
|
|
67
|
+
- `memory_refs`: reference graph
|
|
68
|
+
- `memory_events`: event log
|
|
69
|
+
- `memories_fts`: FTS5 for summary/body text
|
|
70
|
+
|
|
71
|
+
SQLite is rebuildable from Markdown + JSONL.
|
|
72
|
+
|
|
73
|
+
## 5. Audit and Migration
|
|
74
|
+
|
|
75
|
+
- Track schema changes in `spec/changelog.md`.
|
|
76
|
+
- Keep event logs append-only.
|
|
77
|
+
- Provide migration tooling for future protocol updates.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# OmniMemory Session Entry
|
|
2
|
+
|
|
3
|
+
- Current phase:
|
|
4
|
+
- Current objective:
|
|
5
|
+
- Last checkpoint ID:
|
|
6
|
+
- Open risks:
|
|
7
|
+
- Next action:
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
1. Run `omnimemory brief --project <project_id>`
|
|
12
|
+
2. Review top 3 recent checkpoints
|
|
13
|
+
3. Continue task or start a new session
|