> For the complete documentation index, see [llms.txt](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/phases/phase_18/prd_phase_18.md).

# PRD Phase 18: Hermes Memory And Visualization

**Status**: Complete **Sessions**: 2 (initial estimate) **Estimated Duration**: 3-5 days **Source Code Roots**: `V23/` = `/home/aiwithapex/projects/claudeos/claude-os-v2.3/`; `AIOS/` = `/home/aiwithapex/projects/aios/`.

**Progress**: 2/2 sessions (100%)

***

## Overview

Phase 18 upgrades the Memory tab with v2.3's three-layer memory, conversation history, profile grids (sensitive reads), and the Obsidian vault write, and adds the read-only 3D "Mnemosyne" memory constellation as a code-split tab.

Phase 18 is complete as of 2026-06-02. Both sessions are validated and archived after closeout.

**Master reference:** the Phase 16 PRD (`.spec_system/PRD/phase_16/PRD_phase_16.md`) holds the legend, component inventory, Write-Path Safety Contract, write inventory, security model, dependencies, assets, validation strategy, and completion criteria.

**Code reference roots:** `V23/` = `/home/aiwithapex/projects/claudeos/claude-os-v2.3/`; `AIOS/` = `/home/aiwithapex/projects/aios/`.

***

## Progress Tracker

| Session | Name                                               | Status   | Est. Tasks | Validated  |
| ------- | -------------------------------------------------- | -------- | ---------- | ---------- |
| 01      | Memory Upgrade (Sensitive Reads + Obsidian Write)  | Complete | \~16-22    | 2026-06-02 |
| 02      | Mnemosyne 3D Constellation (Read-Only, Code-Split) | Complete | \~16-22    | 2026-06-02 |

***

## Completed Sessions

* Session 01: Memory Upgrade (Sensitive Reads + Obsidian Write)
* Session 02: Mnemosyne 3D Constellation (Read-Only, Code-Split)

***

## Upcoming Sessions

* None in Phase 18.

***

## Objectives

1. Upgrade the Memory tab with the three-layer memory view, manuscript page, conversation history strip, profile memory grid (sensitive read), and the Obsidian vault write through the allow-listed, confined endpoint.
2. Add the Mnemosyne 3D memory constellation as a lazy-loaded, code-split, read-only tab; resolve the bloom rendering approach.

***

## Prerequisites

* Phase 16 completed (`/__hermes_profiles` sensitive read and `/__hermes_obsidian` write registered; hooks/types/demo fixtures present).
* Phase 17 completed (visual shell and tab framework in place).

***

## Technical Considerations

### Architecture

New tabs/sections are added through `AIOS/src/components/hermes/hermes-read-only-page.tsx` (TabsList `:150`, TabsContent `:177-189`). Mnemosyne is heavy and must be code-split (lazy import). The Obsidian write goes through `useHermesAdmin` and the allow-listed vault-path endpoint.

### Source -> Target (per session)

**Session 01 (Memory upgrade, write feature):**

* Source: `HermesMemorySection` V23 `agents.hermes.tsx:4921`, `MemoryThreeLayers` `:4992`, `ManuscriptPage` `:5042`, `CharCountRing` `:5202`, `ConversationHistoryStrip` `:5267`, `ProfileMemoryGrid` `:5321` (sensitive read, `/__hermes_profiles`), `ObsidianBridge` `:5421` *(write -- vault, localStorage keys `:5418-5419`)*.
* Target: extend `AIOS/src/components/hermes/hermes-memory-card.tsx` (`:85`).
* Sensitive reads (full memory bodies, profile grids, Obsidian vault contents) are loopback + token gated. Obsidian write = Write Inventory #16: writes *outside* the Hermes home, so it requires a user-configured vault-path allow-list (not a fixed base dir), confinement, and a confirm step.

**Session 02 (Mnemosyne, read-only):**

* Source: `V23/src/components/hermes-mnemosyne.tsx` (1,104 lines) -- 3D memory constellation, Three.js bloom, auto-orbit, view modes.
* Target: new lazy-loaded `AIOS/src/components/hermes/hermes-mnemosyne.tsx` (code-split -- heavy). Data derived from local memory files (read-only).
* Resolve the bloom approach here (raw `three` ^0.184 already present vs. adding `postprocessing` / `@react-three/fiber`). Treat any new dep as a contained decision in this session, not an upfront install.

### Risks

* **Obsidian write escapes the Hermes home** (Write Inventory #16): Mitigation -- explicit user-configured vault-path allow-list, `confinePath` against the allow-listed root, confirm step, security tests for traversal.
* **Mnemosyne bloom inflates the 3D vendor chunk** (\[P01] bundle budget): Mitigation -- code-split/lazy-load the tab; prefer raw `three` before adding `postprocessing`/`@react-three/fiber`.
* **Sensitive memory bodies leak without the token**: Mitigation -- gate full memory bodies and profile grids behind loopback + token.

### Relevant Considerations

* \[P01] **Bundle budget tight on 3D vendor chunks** (`three.module`): code-split Mnemosyne; revisit if the gzip budget tightens.
* \[P04] **Hermes bridge guardrails must stay intact**: sensitive reads stay token-gated; the Obsidian write stays admin + allow-list gated.

### Open Questions Owned By This Phase

* **Mnemosyne bloom (Session 02):** acceptable on raw `three`, or add `postprocessing`/`@react-three/fiber`? Decide in-session.

***

## Success Criteria

Phase complete when:

* [x] Both sessions completed and validated.
* [x] The Memory tab shows three-layer memory, manuscript, conversation history, and profile grid; sensitive reads are token-gated; the Obsidian write is allow-list-confined, admin-gated, confirmed, and security-tested.
* [x] Mnemosyne renders read-only as a lazy-loaded, code-split tab within bundle budget; the bloom approach is decided and recorded.
* [x] Mode matrix renders for both surfaces; typecheck, lint, and tests pass.

***

## Dependencies

### Depends On

* Phase 16: Hermes v2.3 Port Foundation
* Phase 17: Hermes Shell And Core Writes

### Enables

* Phase 19: Hermes Orchestration And Documents
* Phase 20: Hermes Long-Tail And Parity Sign-off


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/phases/phase_18/prd_phase_18.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
