Skip to content

Knowledge Graph and Tunnels

zhiar edited this page May 29, 2026 · 1 revision

Knowledge Graph & Tunnels

Beyond browsing memories as text, Apricity lets you work with the relationships in your palace: the knowledge graph (facts as subject–predicate–object triples) and tunnels (links between rooms or specific memories).

The knowledge graph

MemPalace stores facts as triples — e.g. Apricity — is-a → front-end. Apricity gives you a view onto them:

  • View triples about an entity, including a chronological timeline of how facts about it changed over time.
  • Add a fact — file a new triple via the add-fact form.
  • Invalidate (End) a fact — when a fact becomes stale (something changed), mark it ended rather than deleting it. This preserves history: the graph records that the fact was true for a period.
  • Force-directed graph visualisation — explore the graph as an interactive node-and-edge diagram.
  • Stats — knowledge-graph aggregate stats and palace graph stats.

Invalidate, don't overwrite. The MemPalace model favours invalidate-then-add over silent overwrites: end the old fact (with the date it stopped being true) and add the corrected one. The timeline then tells the whole story.

Tunnels

A tunnel is a link between two locations in your palace — room↔room or wing↔wing — optionally bound to specific memories on each end. Tunnels capture relationships that don't fit the wing/room tree, like "this HA decision directly affects that Pi runbook."

Where you see them

  • Rooms that have tunnels show a graph-edge glyph in the Rooms pane.
  • Tunnels surface inline as chips on the room rows, so connections are visible while you browse.
  • When a memory is bound to a tunnel, its Detail pane shows a chip with the linked memory; clicking it jumps across.

The tunnel detail page

Click a tunnel to open a dedicated view in the Detail pane:

  • The two endpoints are shown stacked, each with its wing / room (and the bound memory's title, if any).
  • A compact Open memory link appears for an endpoint that's bound to a specific drawer.
  • The tunnel's label is rendered as the body.
  • A Delete tunnel action removes it (snapshotted first — it's recoverable from Recently deleted).

Creating & deleting tunnels

  • Create a tunnel by hand from the Tools panel (Tunnels tab): pick source wing/room and target wing/room, an optional label, and optional source/target drawer bindings.
  • Delete from the tunnel detail page or the Tools panel.

Traverse the graph

From the Tools panel you can graph-traverse N hops from a starting room (capped at 5 hops) to discover indirect connections — rooms reachable through chains of tunnels that wouldn't show up in the inline chip view.

The Tools panel

Most graph/tunnel power-features live in the Tools panel — a sheet that surfaces MemPalace's MCP tools directly. It's hidden by default; enable it in Settings → Display (look for the Tools toggle). It groups:

  • Knowledge Graph — entity query + timeline.
  • Tunnels — list, create, delete, find (between two wings), follow (from a room), graph-traverse.
  • Diary — read / write agent diary entries.
  • Stats — KG stats, palace graph stats, recent checkpoint.
  • Maintenance — taxonomy tree, duplicate check, hook settings, sync from a project tree, reconnect the backend, AAAK spec reference.

Each of these maps to an API endpoint — see the API Reference.

Next: Notifications.

Clone this wiki locally