Skip to content

feat: use pi-memory in projects - #2973

Open
maxy-shpfy wants to merge 1 commit into
masterfrom
maxy/feat--use-pimemory-in-projects
Open

maxy-shpfy wants to merge 1 commit into
masterfrom
maxy/feat--use-pimemory-in-projects

Conversation

@maxy-shpfy

@maxy-shpfy maxy-shpfy commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Gives every Tangent session in a project a shared, persistent memory so later sessions build on what earlier ones learned, instead of each session starting cold with its own private store.

On the first session start in a project, a Tangent shared folder is provisioned and its id is saved in the project metadata (tangentSharedFolderId); subsequent sessions reuse it. Each session then mounts that folder as project/ and binds a composite memory — a human-readable simple-md note under project/NOTES plus a pi-memory store under project/pi-memory — so memory_* tool writes and files are visible across all sessions in the project. When a shared folder exists, the session's standing memory seed also includes a brief explaining how to use it (record decisions/conventions with memory_write, memory_search before re-deriving, keep project/NOTES/MEMORY.md current, never write secrets).

Provisioning is defensive: it reads project metadata from the server (not the cache) because the PATCH replaces the whole metadata object, and re-reads after creating the folder so a folder another tab saved in the meantime wins rather than splitting memory across two stores. The mutation uses a per-project scope so concurrent starts run one at a time and reuse the first folder. Any failure (missing base URL/token, Tangent or project API refusal) resolves to undefined so the session still starts — just without the shared folder.

Also bumps the @tangent/* dependencies from main to a pinned commit that provides the pi-memory memory binding support.

Related Issue and Pull requests

Type of Change

  • New feature

Line Breakdown

Category Added Removed
Production code 209 3
Comments 26 1
Tests 376 0
Config / CI / tooling 4 4
Generated / lockfiles 277 277
Total 892 285

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

Tangent.-.Project.memory.preview.mp4

Test Instructions

  1. Open a project and start a new Tangent session; confirm the project metadata gains a tangentSharedFolderId.
  2. In that session, use memory_write to record something, then start a second session in the same project and confirm memory_search surfaces it and files written under project/ are visible.
  3. Start two sessions in quick succession and confirm only one shared folder is created (reused, not duplicated).
  4. Simulate a shared-folder creation failure (e.g. revoke the token) and confirm the session still starts without a shared folder.

Additional Comments

@maxy-shpfy
maxy-shpfy force-pushed the maxy/feat--use-pimemory-in-projects branch from 3cec55f to 5e388a5 Compare October 31, 2026 05:55
@github-actions

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: maxy/feat--use-pimemory-in-projects/5e388a5

Comment thread package.json
Comment on lines +88 to 92
"@tangent/embed-react": "github:TangleML/tangent-shell#8f2c11c4611eac24732d1e54ac934a2d30905c70&path:packages/embed-react",
"@tangent/remote-subagent": "github:TangleML/tangent-shell#8f2c11c4611eac24732d1e54ac934a2d30905c70&path:packages/remote-subagent",
"@tangent/shared": "github:TangleML/tangent-shell#8f2c11c4611eac24732d1e54ac934a2d30905c70&path:packages/shared",
"@tanstack/history": "1.162.5",
"@tanstack/react-query": "^5.105.0",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes are TMP just for tophatting - will be reverted before merge as soon as shell PR TangleML/tangent-shell#145 landed

@maxy-shpfy
maxy-shpfy marked this pull request as ready for review October 31, 2026 06:42
@maxy-shpfy
maxy-shpfy requested a review from a team as a code owner October 31, 2026 06:42
@Mbeaulne
Mbeaulne self-requested a review November 2, 2026 16:03

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant