Pi-native spatial project memory extension backed by SQLite. Version 1.1.0 (beta). Stores pointers, gotchas, decisions, invariants, purpose, patterns, and plans to help agents re-perceive code faster. Uses project-local SQLite (.pi/portia/portia.sqlite) via better-sqlite3. Provides CLI commands (/portia-status, /portia-search, etc.) and agent tools (portia_sense, portia_record). Follows SemVer for v1.x. Notably does not replace reading source files. Differentiator: lightweight, local-first, inspectable memory layer for Pi agents without external dependencies beyond node >=22 and peer packages (@earendil-works/pi-coding-agent, @earendil-works/pi-tui, typebox). No vector search or cloud sync in v1.
npm install pi-portiaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to install, configure, and use portia with a SQLite database, including recording and searching memories.
Run /portia-status or /portia-doctor first to initialize the database. Do not rely on write commands (portia_record) without prior init.
Upgrade Node.js to version 22 or later. Use nvm or similar to manage versions.
Use documented command names: /portia-status, /portia-doctor, /portia-search, /portia-list, etc. Avoid relying on aliases not explicitly documented.
Check agent tool permissions or use /portia-sense (read-only) first. If write fails, use CLI command /portia-reindex or /portia-repair as fallback.
For substring search, use query like 'SQLite*' (if FTS5 prefix enabled) or rely on programmatic search functions that apply expansions. Check /portia-doctor for configuration.
Install build tools: on Ubuntu, run 'sudo apt-get install python3 make g++'; on macOS, install Xcode Command Line Tools. Then re-run 'npm install' or 'pi install npm:pi-portia'.
Switch to ESM: add "type": "module" to your package.json or use dynamic import: const piPortia = await import('pi-portia').Use CLI command /portia-sense or /portia-doctor instead. For programmatic access, use the portia_sense tool in agent code.
Delete the database file at .pi/portia/portia.sqlite and run /portia-doctor to recreate it. If data is important, restore from backup.