Skip to content

Commit e76fda9

Browse files
Merge pull request #20 from Coding-Dev-Tools/codex/update-readme-pr19
docs: refresh README for PR 19 features
2 parents c66ce50 + d556ad8 commit e76fda9

1 file changed

Lines changed: 136 additions & 6 deletions

File tree

README.md

Lines changed: 136 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,18 @@ embeddings. You bring an LLM only for optional chat, synthesis, structured extra
9696
or structured consolidation.
9797

9898
- **Local-first & private** — runs offline; the core depends only on `numpy`.
99-
- **MCP-native**27 tools for Claude Code, Cursor, Cline, Zed, Windsurf.
99+
- **MCP-native**28 tools for Claude Code, Cursor, Cline, Zed, Windsurf.
100100
- **Self-maintaining facts** — writes are deterministically conflict-resolved (no LLM required).
101+
- **Advisory retention supervision** — an optional LLM can label writes as ephemeral, normal,
102+
or critical; outputs are bounded, clamped, audited, and can never silently drop a write.
101103
- **Principled recall** — six-term score over retention, semantic, lexical, graph, importance, recency.
102104
- **Bi-temporal truth** — contradictions invalidate instead of overwriting (`engraphis_why` / `engraphis_timeline`).
103105
- **Grounded, not guessed** — cited answers or explicit abstain; provenance on every memory.
104106
- **Task-ready context** — bounded proactive packets combine task/agent state, cited memories, suggested follow-ups, and the last-session handoff; optional LLM prose is accepted only when its citations validate.
105107
- **Composable intelligence** — opt-in deterministic conflict triage (`duplicate` / `refinement` / `contradiction` / `obsolete`) and `UserModel` recall reranking helpers; neither changes default recall unless called.
108+
- **Human-governed lifecycle** — pin, forget, correct, promote to a wider scope, and manually merge several memories into one without deleting their history; every change is audited.
109+
- **One layered graph** — temporal, entity, causal, and semantic overlays share the same database, with persistent code↔memory links and intent-aware recall.
110+
- **Privacy-safe receipts** — remember, link, recall, and indexing operations can be verified through a content-free SHA-256 receipt chain without exporting memory or query text.
106111
- **Code-aware** — incremental multi-language symbol/call/import graph, code↔memory links,
107112
path queries, communities/hotspots, git/PR impact analysis, and portable graph exports.
108113
- **Sleep-time consolidation** — scheduled job distills recurring episodes, reports its compaction.
@@ -146,6 +151,11 @@ first admin, invite members, and connect agents).
146151
> `ENGRAPHIS_FORWARDED_ALLOW_IPS=*` — both one-click steps in the Railway dashboard;
147152
> full walk-through in the hosting guide.
148153
154+
Hosted **Agent Connect** tokens are per-user, shown only once, and stored only as SHA-256
155+
digests. Roles are rechecked on every HTTP/MCP call; disabling a member or resetting their
156+
password permanently revokes existing agent tokens. The hosted `/mcp` endpoint exposes the same
157+
28-tool service as local `engraphis-mcp`. See [the Agent Connect guide](docs/AGENT_CONNECT.md).
158+
149159
## Install
150160

151161
```bash
@@ -202,8 +212,8 @@ engraphis-init # writes .env + prints config snippets
202212
claude mcp add engraphis -- engraphis-mcp
203213
```
204214

205-
Your agent now has 27 tools — remember, recall (grounded + proactive), proactive context,
206-
grounded answer alias, why, timeline, forget, pin, correct, ingest, consolidate, index_repo,
215+
Your agent now has 28 tools — remember, recall (grounded + proactive), proactive context,
216+
grounded answer alias, why, timeline, forget, pin, correct, promote, ingest, consolidate, index_repo,
207217
search/code path/impact/export, privacy receipts, PostgreSQL schema ingestion, link,
208218
record_event, start/end_session, and stats. See the [MCP tools table](#mcp-tools) below.
209219

@@ -212,15 +222,35 @@ record_event, start/end_session, and stats. See the [MCP tools table](#mcp-tools
212222
```bash
213223
pip install "engraphis[code]"
214224
engraphis-graph index -w acme -r api --root .
225+
engraphis-graph search -w acme -r api "UserService"
215226
engraphis-graph query -w acme -r api "where is token rotation implemented?"
216227
engraphis-graph explain -w acme -r api "why does deploy depend on approval?"
217228
engraphis-graph path -w acme -r api UserService DatabasePool
218229
engraphis-graph impact -w acme -r api --root . --git-range origin/main...HEAD
230+
engraphis-graph prs -w acme -r api --base main --head HEAD
219231
engraphis-graph export -w acme -r api -o engraphis-graph-out
232+
engraphis-graph install-merge-driver --root .
220233
```
221234

222235
The export contains `graph.json`, a self-contained `graph.html`, and `GRAPH_REPORT.md`.
223-
See [the v3 architecture/design document](docs/ARCHITECTURE_V3.md).
236+
Indexing supports Python, JavaScript, TypeScript, Go, Rust, Java, C#, C, C++, SQL, and
237+
Terraform. Tree-sitter is used when available; the dependency-free regex backend remains a
238+
functional fallback. Definitions, methods, calls, imports, ownership, variables,
239+
inheritance/implementation, and docstrings/comments are indexed. Indexing is incremental by
240+
content hash, honors `.engraphisignore`, and does not follow file symlinks outside the repository
241+
root. Call edges are name-based and best-effort rather than type-resolved. The optional Git merge
242+
driver validates bounded graph JSON and deterministically unions nodes and edges instead of
243+
choosing one export side.
244+
245+
For a read-only recall and graph API that can be shared without exposing write operations:
246+
247+
```bash
248+
pip install "engraphis[server]"
249+
engraphis-graph-server # http://127.0.0.1:8720/docs
250+
```
251+
252+
A non-loopback bind fails closed unless `ENGRAPHIS_GRAPH_TOKEN` (or
253+
`ENGRAPHIS_API_TOKEN`) is set. See [the v3 architecture/design document](docs/ARCHITECTURE_V3.md).
224254

225255
---
226256

@@ -239,6 +269,40 @@ The same `MemoryService` backs the dashboard and the MCP server.
239269

240270
---
241271

272+
## Govern memories without losing history
273+
274+
Engraphis separates automatic write resolution from explicit human governance:
275+
276+
| Operation | Use it when | What happens to history |
277+
|---|---|---|
278+
| `remember` | Adding or restating one fact | Deterministically adds, reinforces, or supersedes a same-scope memory |
279+
| `correct` | Replacing one known-wrong memory | Closes the old validity window and links the replacement |
280+
| `promote` | A narrow learning now applies more broadly | Writes a wider-scope successor and closes/links the source instead of editing scope in place |
281+
| `merge` | Combining two or more overlapping memories | Retires every source and creates one memory that supersedes all of them |
282+
| `forget` | Removing a memory from live recall | Bi-temporally closes it; the audit/history record remains |
283+
| `consolidate` | Distilling recurring episodic memories automatically | Creates linked semantic digests; sources stay live unless explicit supersession is requested |
284+
285+
Manual N→1 merge is available through `MemoryService.merge()` and `POST /api/merge`:
286+
287+
```python
288+
a = mem.remember("Deploys happen Friday at 3pm.", workspace="acme")
289+
b = mem.remember("We deploy Fridays around 15:00.", workspace="acme")
290+
291+
merged = mem.merge(
292+
[a["id"], b["id"]],
293+
"Deploys ship every Friday at approximately 15:00.",
294+
workspace="acme",
295+
reason="deduplicate the deployment schedule",
296+
)
297+
print(merged["compaction"])
298+
```
299+
300+
All sources must belong to the named workspace. The result inherits the strictest source
301+
sensitivity, remains untrusted if any source was untrusted, and stays pinned if any source was
302+
pinned. The full multi-predecessor chain remains visible through inspection, Why, and Timeline.
303+
304+
---
305+
242306
## Free forever vs. Pro
243307

244308
The core engine, single-user dashboard, standalone MCP server, and governance tools are
@@ -257,7 +321,7 @@ server-issued Pro or Team trial** after email confirmation — no card required.
257321
| | Free (available now) | Pro — $10/mo or $100/yr | Team — $20/seat/mo or $200/seat/yr |
258322
|---|---|---|---|
259323
| Dashboard WebUI (with built-in inspector) ||||
260-
| Memory engine + 27 MCP tools ||||
324+
| Memory engine + 28 MCP tools ||||
261325
| Version-chain diffs, offline knowledge graph ||||
262326
| Cloud sync (folder + managed relay) | |||
263327
| Auto-sync (hands-off cadence) | |||
@@ -300,11 +364,39 @@ server-issued Pro or Team trial** after email confirmation — no card required.
300364
| Governance | `engraphis_forget` | Retire a memory — bi-temporal close, never deleted |
301365
| Governance | `engraphis_pin` | Exempt from future automatic decay/pruning |
302366
| Governance | `engraphis_correct` | Replace content without losing history |
367+
| Governance | `engraphis_promote` | Widen scope while preserving and linking narrow-scope history |
303368
| Session | `engraphis_start_session` / `engraphis_end_session` | Session lifecycle with cross-session handoff |
304369
| Ops | `engraphis_stats` | Memory counts for health checks |
305370

306371
---
307372

373+
## Layered graph and privacy receipts
374+
375+
Memory relationships, extracted entities, and code structure stay normalized in one SQLite
376+
database. Edges are tagged as `temporal`, `entity`, `causal`, or `semantic`, so callers can
377+
select a logical overlay without maintaining separate graphs. Schema-v3 migration is additive
378+
and idempotent: existing memories and bi-temporal history remain in place, while legacy edge
379+
layers are inferred once.
380+
381+
`MemoryService.intent_remember()`, `intent_link()`, and `intent_recall()` provide a
382+
transport-neutral agent protocol while the existing `engraphis_remember`, `engraphis_link`, and
383+
`engraphis_recall` tools remain the canonical MCP vocabulary. Explicit links can persist both a
384+
layer and a durable rationale. Intent recall maps `explain`, `summarize_history`, and
385+
`locate_code` to appropriate layer filters; code intents also return matching symbols when a
386+
repository is supplied.
387+
388+
The operation-receipt chain is deliberately content-free. It records bounded operation metadata
389+
and chained hashes, while excluding raw memory/query text, workspace names, memory IDs, and actor
390+
identities from exported receipt payloads. Use `engraphis_receipts`,
391+
`engraphis_verify_receipts`, and `engraphis_export_receipts` to inspect the chain or compare it
392+
with a previously saved head/count anchor. A separately maintained local count/head anchor and
393+
persistent integrity marker make interior edits, reordering, and tail truncation detectable.
394+
395+
See [the v3 architecture document](docs/ARCHITECTURE_V3.md) for the data flow and
396+
[SECURITY.md](SECURITY.md) for the trust boundaries.
397+
398+
---
399+
308400
## Cloud sync
309401

310402
Cloud sync keeps your memory store consistent across all your machines — and, on the Team
@@ -317,10 +409,38 @@ tier, across a group — without giving up local-first ownership. It ships two t
317409

318410
Sync is a **state-based CRDT**: deterministic merge, no conflict copies, no data loss.
319411
Every field resolves by a commutative, idempotent rule so `merge(A, B) == merge(B, A)`.
412+
The current sync format carries memories and their memory-to-memory links; entity/code graph
413+
reconciliation is not yet part of sync. `secret` memories are never exported, and Team personal
414+
folders are never uploaded to a shared-account relay. Managed-relay traffic uses HTTPS, but
415+
bundles are not yet client-side end-to-end encrypted or zero-knowledge.
320416
See [`docs/SYNC.md`](docs/SYNC.md) for architecture, security model, and CLI usage.
321417

322418
---
323419

420+
## Security and trust boundaries
421+
422+
[PR #19](https://github.com/Coding-Dev-Tools/engraphis/pull/19) hardened the shared and
423+
commercial surfaces as well as adding features:
424+
425+
- **Team authentication** — concurrent seat/admin/password-reset changes are serialized and
426+
enforced server-side; sessions and agent-token history are bounded, and disable/reset events
427+
revoke long-lived tokens.
428+
- **Relay isolation** — workspace scope is rechecked in both directions, personal Team folders
429+
cannot enter the shared-account relay, and device-local `secret` memories cannot be remotely
430+
overwritten, invalidated, or downgraded. Relay bundle size, count, and per-workspace storage
431+
are bounded.
432+
- **Hostile-input handling** — sync-folder peers, graph merge inputs, repository walks, resource
433+
files, and PostgreSQL selectors are treated as untrusted; traversal, symlink/replace races,
434+
oversized/deep payloads, malformed rows, and non-finite JSON are rejected.
435+
- **Fail-closed networking** — managed service clients reject insecure or malformed endpoints;
436+
relay clients do not forward bearer credentials across HTTP redirects. The read-only graph
437+
server also refuses a non-loopback bind without a token.
438+
439+
See [SECURITY.md](SECURITY.md) for supported versions, deployment requirements, known gaps, and
440+
the vulnerability-reporting process.
441+
442+
---
443+
324444
## Encryption at rest
325445

326446
Set `ENGRAPHIS_DB_KEY` (or `ENGRAPHIS_DB_KEY_FILE`) and install the extra:
@@ -416,6 +536,8 @@ All via environment (or `.env`):
416536
| `ENGRAPHIS_HOST` | `127.0.0.1` | Server bind address |
417537
| `ENGRAPHIS_PORT` | `8700` | Dashboard port |
418538
| `ENGRAPHIS_API_TOKEN` || If set, REST API requires `Authorization: Bearer <token>` |
539+
| `ENGRAPHIS_CORS_ORIGINS` | loopback origins | Comma-separated REST CORS allow-list |
540+
| `ENGRAPHIS_WORKSPACES` || Optional comma-separated server-side workspace allow-list |
419541
| `ENGRAPHIS_DB_KEY` || Encrypt the database at rest (SQLCipher). Or use `ENGRAPHIS_DB_KEY_FILE` |
420542
| `ENGRAPHIS_EMBED_MODEL` | `sentence-transformers/all-MiniLM-L6-v2` | sentence-transformers model |
421543
| `ENGRAPHIS_EXTRACTOR` | `none` | `none` = verbatim; `chunk` = offline structure-aware chunks; `llm` = free-form LLM facts; `llm_structured` = schema-validated facts + graph metadata |
@@ -426,12 +548,14 @@ All via environment (or `.env`):
426548
| `ENGRAPHIS_POSTGRES_CONNECT_TIMEOUT` | `10` | PostgreSQL introspection connection timeout in seconds (bounded to 1–120) |
427549
| `ENGRAPHIS_POSTGRES_STATEMENT_TIMEOUT_MS` | `30000` | Per-introspection PostgreSQL statement timeout in milliseconds (bounded to 1–300000) |
428550
| `ENGRAPHIS_GRAPH_TOKEN` || Bearer token for `engraphis-graph-server`; required off-loopback |
551+
| `ENGRAPHIS_GRAPH_HOST` / `ENGRAPHIS_GRAPH_PORT` | `127.0.0.1` / `8720` | Read-only graph/recall server bind address |
429552
| `ENGRAPHIS_LLM_PROVIDER` | `openai` | `openai \| anthropic \| google \| openrouter \| custom` |
430553
| `ENGRAPHIS_LLM_MODEL` | `gpt-4o-mini` | Model name (provider-specific) |
431554
| `ENGRAPHIS_LLM_API_KEY` || API key for chat/synthesis, `llm` / `llm_structured` extraction, and structured consolidation |
432555
| `ENGRAPHIS_LLM_BASE_URL` || Base URL for openrouter / custom OpenAI-compatible endpoints |
433556
| `ENGRAPHIS_LICENSE_KEY` || Pro/Team key (or `~/.engraphis/license.key`) |
434557
| `ENGRAPHIS_TEAM_MODE` | `1` | Mount Team features by default; the auth wall activates for a live Team license or an existing team. Set `0` to disable |
558+
| `ENGRAPHIS_DASHBOARD_URL` || Canonical public Team URL used in invites and the hosted MCP Host/Origin allow-list |
435559
| `ENGRAPHIS_LOOP_INTERVAL` | `60` | Background consolidation loop interval in seconds (0 = disabled) |
436560
| `ENGRAPHIS_DECAY_HALFLIFE_DAYS` | `7` | Ebbinghaus decay half-life (higher = memories persist longer) |
437561
| `ENGRAPHIS_FORWARDED_ALLOW_IPS` | `127.0.0.1` | Trusted reverse-proxy IPs for TLS termination (`*` = trust all) |
@@ -451,8 +575,9 @@ engraphis/
451575
│ ├── core/ # v2 engine — interfaces, store, recall, scoring, schema, sync
452576
│ ├── backends/ # pluggable embedder / vector index / reranker / codegraph / sync transports / encryption
453577
│ ├── service.py # validated MemoryService facade
454-
│ ├── mcp_server.py # MCP server — 27 tools
578+
│ ├── mcp_server.py # MCP server — 28 tools
455579
│ ├── dashboard_app.py # dashboard WebUI (FastAPI)
580+
│ ├── read_only_api.py # token-protected recall/repository-graph HTTP surface
456581
│ ├── autosync.py # background auto-sync loop (Pro/Team)
457582
│ ├── licensing.py # license verification (offline + cloud)
458583
│ ├── analytics.py # Pro analytics engine
@@ -468,6 +593,11 @@ engraphis/
468593
└── pyproject.toml
469594
```
470595

596+
New capability belongs in the v2 path (`engraphis/core/`, `engraphis/backends/`, and
597+
`MemoryService`) behind the interfaces in `core/interfaces.py`. The flat-namespace v1 server
598+
under `engraphis/app.py`, `routes/`, `stores/`, and `engines/` remains a compatibility/reference
599+
surface; `engraphis-dashboard`, the MCP server, and the Python quickstart above use v2.
600+
471601
---
472602

473603
## Development

0 commit comments

Comments
 (0)