Skip to content

Commit 9054aed

Browse files
committed
feat: sync premium bootstrap template and docs
1 parent e00dda0 commit 9054aed

13 files changed

Lines changed: 659 additions & 65 deletions

File tree

README.md

Lines changed: 86 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
A production-quality SQLite-backed MCP Memory stack with WAL concurrent safety (10+ sessions), FTS5 BM25 search, session tracking, task management, bridge sync, collaboration workflows, and a native system tray task manager.
1010

11-
Drop-in compatible with `@modelcontextprotocol/server-memory` for the core 9 knowledge-graph tools, with 41 additional tools split across companion FastMCP micro-servers for sessions, tasks, bridge sync, collaboration, entity linking, and intelligence workflows (50 tools total). Includes a PyQt6 desktop app for visual task management and standalone automation scripts.
11+
Drop-in compatible with `@modelcontextprotocol/server-memory` for the core 9 knowledge-graph tools, with 47 additional tools split across companion FastMCP micro-servers for sessions, tasks, bridge sync, collaboration, entity linking, and intelligence workflows (56 OSS tools total). Includes a PyQt6 desktop app for visual task management and standalone automation scripts.
1212

1313
## Why SQLite?
1414

@@ -37,7 +37,7 @@ SQLite hits the sweet spot:
3737
- **Cross-project sharing** -- Optional `project` field scopes entities; omit it to share across all projects
3838
- **Cross-machine sync** -- Bridge tools push/pull shared entities between machines via a private git repo
3939
- **Premium runtime boundary** -- The OSS core can gate-load a separate private premium repo via signed entitlement checks, explicit owner approval, audit logging, and local revocation
40-
- **Drop-in compatible core** -- All 9 tools from `@modelcontextprotocol/server-memory` work identically in `sqlite_memory`, with 41 more tools available from companion servers
40+
- **Drop-in compatible core** -- All 9 tools from `@modelcontextprotocol/server-memory` work identically in `sqlite_memory`, with 47 more tools available from companion servers
4141
- **Zero required dependencies beyond stdlib** -- Only `fastmcp` is required for MCP protocol; `sqlite3` is Python stdlib. Optional `orjson`, `sqlite-vec`, and `sentence-transformers` add speed and semantic search
4242
- **Automatic FTS sync** -- Full-text index stays in sync with every write operation
4343
- **JSONL migration** -- Optionally import existing `memory.json` knowledge graphs on first run
@@ -83,6 +83,84 @@ The public runtime will only attempt to mount them when all of the following are
8383

8484
Without a valid entitlement and local approval path, the premium runtime stays off and private extensions are not mounted.
8585

86+
### Premium feature packs
87+
88+
The premium layer is not meant to be a vague "enterprise edition". It is structured as a set of **gated operational packs** that sit on top of the OSS memory core.
89+
90+
#### 1. ACL / RBAC control plane
91+
92+
This pack is for teams that need more than "who has the database file".
93+
94+
- define premium roles per global, project, client, or mailbox scope
95+
- assign those roles to users, teams, or agents
96+
- evaluate whether a principal may read, write, ingest, publish, or escalate within a given scope
97+
98+
The point is not cosmetic permissions. The point is to stop one shared memory instance from becoming a flat trust domain once multiple people, clients, mailboxes, and AI agents are involved.
99+
100+
#### 2. Governance / audit decision layer
101+
102+
This pack records why a high-impact memory action was allowed, rejected, escalated, or published.
103+
104+
- record governance decisions with rationale, evidence, and risk level
105+
- summarize the active governance surface for review
106+
- keep premium review activity in an auditable path instead of burying it in ad hoc notes
107+
108+
This matters when the system starts influencing partner communication, escalation handling, or management-facing summaries.
109+
110+
#### 3. Communication memory / multi-mailbox ingestion
111+
112+
This pack turns the memory layer into a client-thread and operational follow-up surface.
113+
114+
- register multiple mailboxes or shared inboxes
115+
- ingest thread/message metadata with client scope and participants
116+
- build follow-up queues based on the latest thread state
117+
- keep communication memory separated by mailbox and client boundary
118+
119+
This is the premium line where the product stops being only "knowledge memory" and starts acting like governed operational memory.
120+
121+
#### 4. Partner digest / management summary pipelines
122+
123+
This is the premium summarization layer built on top of governance and communication memory.
124+
125+
- partner-grade digests
126+
- management summaries
127+
- unresolved-risk and escalation views
128+
- high-signal briefings over selected scopes rather than global memory dumps
129+
130+
These workflows are intentionally premium-only because they combine communication access, ranking, and decision framing in ways that should not run by default.
131+
132+
#### 5. Advanced ranking / orchestration
133+
134+
This pack is for cases where the public retrieval baseline is not enough.
135+
136+
- premium reranking over client, partner, and mailbox context
137+
- queue prioritization and escalation ordering
138+
- multi-step orchestration for premium-only retrieval and digest pipelines
139+
140+
The public repo exposes the runtime boundary for this. The proprietary heuristics and orchestration logic stay outside the OSS tree.
141+
142+
#### 6. High-control deployment surfaces
143+
144+
This is the control layer for customers that need stronger operational guarantees.
145+
146+
- explicit entitlements
147+
- local revocation
148+
- owner approval for protected premium features
149+
- separate private runtime packaging
150+
- optional extra service boundaries for the most sensitive premium logic
151+
152+
This is where the premium design stops depending on trust in the local machine and starts depending on gated execution, auditability, and runtime separation.
153+
154+
### Current premium bootstrap scope
155+
156+
The current private premium bootstrap is organized around three real pack families:
157+
158+
- `acl_rbac`
159+
- `governance_audit`
160+
- `multi_mailbox_ingestion`
161+
162+
That bootstrap is intentionally separate from the OSS repo. The public repo ships the airlock, contract, schema hooks, and template. The premium logic itself stays outside the OSS tree.
163+
86164
See:
87165

88166
- [`premium_contract.py`](premium_contract.py)
@@ -122,7 +200,7 @@ pip install -e .
122200
# Add the core drop-in server
123201
claude mcp add sqlite_memory python /path/to/server.py
124202

125-
# Add companion servers for the full 50-tool stack
203+
# Add companion servers for the full 56-tool OSS stack
126204
claude mcp add sqlite_tasks python /path/to/task_server.py
127205
claude mcp add sqlite_session python /path/to/session_server.py
128206
claude mcp add sqlite_bridge python /path/to/bridge_server.py
@@ -162,7 +240,7 @@ Add these server/file pairs to your `~/.claude/settings.json` under `mcpServers`
162240
| `sqlite_collab` | `collab_server.py` | Collaborator and public-knowledge workflows |
163241
| `sqlite_entity` | `entity_server.py` | Task-entity linking and merge helpers |
164242
| `sqlite_intel` | `intel_server.py` | Context assessment and enrichment tools |
165-
| `sqlite_unified` | `unified_server.py` | Optional all-in-one server that mounts the full 50-tool stack |
243+
| `sqlite_unified` | `unified_server.py` | Optional all-in-one server that mounts the full 56-tool OSS stack |
166244

167245
Each server should share the same environment values:
168246

@@ -269,17 +347,17 @@ CREATE VIRTUAL TABLE IF NOT EXISTS memory_fts USING fts5(
269347

270348
## Tool Reference
271349

272-
The 50 tools are grouped by MCP server:
350+
The 56 OSS tools are grouped by MCP server:
273351

274352
| MCP server | Tool count | Tools |
275353
|---|---:|---|
276354
| `sqlite_memory` | 9 | `create_entities`, `add_observations`, `create_relations`, `delete_entities`, `delete_observations`, `delete_relations`, `read_graph`, `search_nodes`, `open_nodes` |
277355
| `sqlite_session` | 5 | `session_save`, `session_recall`, `search_by_project`, `knowledge_health`, `resume_context` |
278-
| `sqlite_tasks` | 6 | `create_task_or_note`, `update_task`, `query_tasks`, `task_digest`, `archive_done_tasks`, `bump_overdue_priority` |
279-
| `sqlite_bridge` | 6 | `bridge_push`, `bridge_pull`, `bridge_status`, `assign_task`, `review_shared_tasks`, `process_recurring_tasks` |
356+
| `sqlite_tasks` | 7 | `create_task_or_note`, `update_task`, `query_tasks`, `find_by_title`, `task_digest`, `archive_done_tasks`, `bump_overdue_priority` |
357+
| `sqlite_bridge` | 7 | `bridge_push`, `bridge_pull`, `bridge_status`, `bridge_doctor`, `assign_task`, `review_shared_tasks`, `process_recurring_tasks` |
280358
| `sqlite_collab` | 9 | `manage_collaborators`, `share_knowledge`, `review_shared_knowledge`, `request_publish`, `cancel_publish`, `search_public_knowledge`, `rate_public_knowledge`, `get_knowledge_ratings`, `update_verification` |
281359
| `sqlite_entity` | 7 | `link_task_entity`, `unlink_task_entity`, `get_task_links`, `get_entity_tasks`, `suggest_task_links`, `find_entity_overlaps`, `merge_entities` |
282-
| `sqlite_intel` | 8 | `assess_context`, `queue_clarification`, `record_human_answer`, `extract_candidate_claims`, `promote_candidate`, `build_context_pack`, `explain_impact`, `enrich_context` |
360+
| `sqlite_intel` | 12 | `assess_context`, `queue_clarification`, `record_human_answer`, `extract_candidate_claims`, `promote_candidate`, `build_context_pack`, `explain_impact`, `audit_memory`, `replay_memory`, `govern_fact`, `list_memory_issues`, `enrich_context` |
283361

284362
## Bridge Sync (Cross-Machine)
285363

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "sqlite-memory-mcp"
3-
version = "3.4.0"
4-
description = "SQLite-backed MCP Memory Server with hybrid search (BM25 + semantic via sqlite-vec), Intelligence v2, causal event ledger, context state machine, knowledge tiers, WAL concurrent safety, cross-machine bridge sync, and 54 MCP tools"
3+
version = "3.5.0"
4+
description = "SQLite-backed MCP Memory Server with hybrid search (BM25 + semantic via sqlite-vec), Intelligence v2, causal event ledger, premium runtime boundary, context state machine, knowledge tiers, WAL concurrent safety, cross-machine bridge sync, and 56 OSS MCP tools"
55
requires-python = ">=3.10"
66
dependencies = ["fastmcp>=2.0.0"]
77
license = {text = "MIT"}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
__pycache__/
2+
*.pyc
3+
*.pyo
4+
*.pyd
5+
.pytest_cache/
6+
.ruff_cache/
7+
.venv/
8+
dist/
9+
build/

templates/private_premium_repo/README.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
Public-safe bootstrap template for a **separate private premium repo**.
44

5+
This template mirrors the resilient bootstrap layout of the real private
6+
premium runtime, but keeps the premium business logic replaced with safe
7+
placeholders.
8+
59
This template is intentionally safe to keep in the OSS repo:
610

711
- no private keys
812
- no customer entitlements
9-
- no premium business logic
10-
- no proprietary retrieval/ranking rules
13+
- no premium connector secrets
14+
- no proprietary ranking / governance logic
1115

1216
## Purpose
1317

@@ -18,9 +22,25 @@ Use this template to start a private repository that implements:
1822
- private connector logic
1923
- premium governance / ACL / ingestion workflows
2024

25+
## Template layout
26+
27+
The template mirrors the private bootstrap structure:
28+
29+
- `sqlite_memory_premium/app.py`
30+
- `sqlite_memory_premium/host_api.py`
31+
- `sqlite_memory_premium/runtime_state.py`
32+
- `sqlite_memory_premium/schema.py`
33+
- `sqlite_memory_premium/acl_governance.py`
34+
- `sqlite_memory_premium/communication_memory.py`
35+
- `sqlite_memory_premium/register.py`
36+
37+
The placeholder tools in this template are there to preserve the contract and
38+
module boundaries, not to expose premium logic.
39+
2140
## Expected host
2241

23-
This template is meant to run next to the public `sqlite-memory-mcp` repo and use:
42+
This template is meant to run next to the public `sqlite-memory-mcp` repo and
43+
use:
2444

2545
- `premium_runtime.py`
2646
- `premium_contract.py`
@@ -29,10 +49,11 @@ This template is meant to run next to the public `sqlite-memory-mcp` repo and us
2949

3050
1. Create a new **private** repo.
3151
2. Copy this template into that repo.
32-
3. Implement premium-only tools under `sqlite_memory_premium/`.
52+
3. Replace the placeholder tools in `sqlite_memory_premium/`.
3353
4. Point `SQLITE_MEMORY_PREMIUM_ENTRYPOINT` to the private module.
3454
5. Load through the gated public runtime only.
3555

3656
## Important boundary
3757

38-
Do not move secrets, signatures, entitlement issuance, or real premium logic into the public repo.
58+
Do not move secrets, signatures, entitlement issuance, or real premium logic
59+
into the public repo.

templates/private_premium_repo/pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
name = "sqlite-memory-mcp-premium-template"
33
version = "0.1.0"
44
description = "Private premium repo template for sqlite-memory-mcp"
5+
readme = "README.md"
56
requires-python = ">=3.10"
67
dependencies = ["fastmcp>=2.0.0"]
78

89
[build-system]
910
requires = ["setuptools>=61.0"]
1011
build-backend = "setuptools.build_meta"
12+
13+
[tool.setuptools.packages.find]
14+
include = ["sqlite_memory_premium*"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
"""Private premium repo template package."""
2+
3+
__all__ = ["__version__"]
4+
__version__ = "0.1.0"
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
"""Placeholder premium ACL and governance tools for the public template."""
2+
3+
from __future__ import annotations
4+
5+
import json
6+
7+
from . import host_api
8+
from .app import premium_mcp
9+
from .runtime_state import denied_response, require_feature
10+
from .schema import ensure_private_schema
11+
12+
13+
def _template_response(feature_id: str, tool_name: str) -> str:
14+
return json.dumps(
15+
{
16+
"status": "template_only",
17+
"feature_id": feature_id,
18+
"tool_name": tool_name,
19+
"note": (
20+
"Replace this placeholder with the real private premium implementation."
21+
),
22+
},
23+
ensure_ascii=False,
24+
sort_keys=True,
25+
)
26+
27+
28+
@premium_mcp.tool()
29+
def premium_acl_upsert_role(
30+
role_name: str,
31+
permissions_json: str,
32+
description: str = "",
33+
scope_kind: str = "global",
34+
scope_ref: str = "",
35+
) -> str:
36+
"""Template placeholder for premium RBAC role definition."""
37+
verdict = require_feature(
38+
"acl_rbac",
39+
tool_name="sqlite-premium-template.premium_acl_upsert_role",
40+
payload={"role_name": role_name, "scope_kind": scope_kind},
41+
)
42+
if not verdict.get("allowed"):
43+
return denied_response("acl_rbac", verdict)
44+
with host_api.get_conn() as conn:
45+
ensure_private_schema(conn)
46+
return _template_response("acl_rbac", "premium_acl_upsert_role")
47+
48+
49+
@premium_mcp.tool()
50+
def premium_acl_assign_role(
51+
principal_type: str,
52+
principal_id: str,
53+
role_name: str,
54+
scope_kind: str = "global",
55+
scope_ref: str = "",
56+
granted_by: str = "system",
57+
expires_at: str = "",
58+
) -> str:
59+
"""Template placeholder for premium RBAC role assignment."""
60+
verdict = require_feature(
61+
"acl_rbac",
62+
tool_name="sqlite-premium-template.premium_acl_assign_role",
63+
payload={"role_name": role_name, "principal_type": principal_type},
64+
)
65+
if not verdict.get("allowed"):
66+
return denied_response("acl_rbac", verdict)
67+
with host_api.get_conn() as conn:
68+
ensure_private_schema(conn)
69+
return _template_response("acl_rbac", "premium_acl_assign_role")
70+
71+
72+
@premium_mcp.tool()
73+
def premium_acl_check_access(
74+
principal_type: str,
75+
principal_id: str,
76+
permission: str,
77+
scope_kind: str = "global",
78+
scope_ref: str = "",
79+
) -> str:
80+
"""Template placeholder for premium RBAC access evaluation."""
81+
verdict = require_feature(
82+
"acl_rbac",
83+
tool_name="sqlite-premium-template.premium_acl_check_access",
84+
payload={"principal_type": principal_type, "permission": permission},
85+
)
86+
if not verdict.get("allowed"):
87+
return denied_response("acl_rbac", verdict)
88+
with host_api.get_conn() as conn:
89+
ensure_private_schema(conn)
90+
return _template_response("acl_rbac", "premium_acl_check_access")
91+
92+
93+
@premium_mcp.tool()
94+
def premium_governance_record_decision(
95+
title: str,
96+
decision: str,
97+
subject_kind: str,
98+
subject_id: str = "",
99+
rationale: str = "",
100+
evidence_json: str = "[]",
101+
risk_level: str = "medium",
102+
scope_kind: str = "global",
103+
scope_ref: str = "",
104+
created_by: str = "system",
105+
) -> str:
106+
"""Template placeholder for premium governance decision recording."""
107+
verdict = require_feature(
108+
"governance_audit",
109+
tool_name="sqlite-premium-template.premium_governance_record_decision",
110+
payload={"title": title, "subject_kind": subject_kind},
111+
)
112+
if not verdict.get("allowed"):
113+
return denied_response("governance_audit", verdict)
114+
with host_api.get_conn() as conn:
115+
ensure_private_schema(conn)
116+
return _template_response(
117+
"governance_audit",
118+
"premium_governance_record_decision",
119+
)
120+
121+
122+
@premium_mcp.tool()
123+
def premium_governance_audit_digest(
124+
limit: int = 10,
125+
risk_level: str = "",
126+
scope_kind: str = "",
127+
scope_ref: str = "",
128+
) -> str:
129+
"""Template placeholder for premium governance audit summaries."""
130+
verdict = require_feature(
131+
"governance_audit",
132+
tool_name="sqlite-premium-template.premium_governance_audit_digest",
133+
payload={"limit": limit, "risk_level": risk_level or None},
134+
)
135+
if not verdict.get("allowed"):
136+
return denied_response("governance_audit", verdict)
137+
with host_api.get_conn() as conn:
138+
ensure_private_schema(conn)
139+
return _template_response("governance_audit", "premium_governance_audit_digest")
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""Shared FastMCP app for template premium tools."""
2+
3+
from __future__ import annotations
4+
5+
from fastmcp import FastMCP
6+
7+
premium_mcp = FastMCP(
8+
"sqlite-memory-premium-template",
9+
instructions=(
10+
"Template private premium MCP runtime for sqlite-memory-mcp. "
11+
"Replace the placeholder tools with real premium-only capabilities."
12+
),
13+
)

0 commit comments

Comments
 (0)