Goal
Implement a PostgreSQL storage adapter for the Memact/Memory repository to support robust server-side database persistence, replacing the local JSON file adapter for production environments.
This should implement the load/save adapter contract defined in src/storage.mjs.
CC: @rach-kanc — this issue is aligned with the new V1 architecture to replace the deprecated design proposed in the closed Issue #42.
Proposed Database Schema
The database schema should store V1 Memory concepts aligned with the Supabase setup:
-
memact_memory_entries (user-approved memory statements):
-
id (UUID, primary key)
-
user_id (UUID, link to user profile)
-
category (VARCHAR, e.g., 'fitness', 'learning')
-
content (TEXT, approved statement)
-
visibility (VARCHAR, 'private' | 'friends' | 'public')
-
is_starred (BOOLEAN)
-
created_at (TIMESTAMP WITH TIME ZONE)
-
updated_at (TIMESTAMP WITH TIME ZONE)
-
memact_app_permissions (app category access grants):
Work to Do
Acceptance Criteria
-
PostgreSQL adapter can be initialized and loaded via connection string/URL configuration.
-
Storage reads/writes successfully persist to PostgreSQL.
-
All existing Memory engine tests pass with the database adapter loaded.
SSoC26 Contributor Notice:
Since this repository (Memact/Memory) is outside the main Context repository, and the registered project for tracking contributions is specifically Context (Memact/Context), please make sure to create a dummy PR in the Context repository linking to your actual PR or commits in this repository. This is required for your contribution to be correctly tracked and counted.
If you have already created a dummy PR in Memact/Context linking to your work here, please ignore this message!
Goal
Implement a PostgreSQL storage adapter for the
Memact/Memoryrepository to support robust server-side database persistence, replacing the local JSON file adapter for production environments.This should implement the load/save adapter contract defined in
src/storage.mjs.CC: @rach-kanc — this issue is aligned with the new V1 architecture to replace the deprecated design proposed in the closed Issue #42.
Proposed Database Schema
The database schema should store V1 Memory concepts aligned with the Supabase setup:
memact_memory_entries (user-approved memory statements):
id(UUID, primary key)user_id(UUID, link to user profile)category(VARCHAR, e.g., 'fitness', 'learning')content(TEXT, approved statement)visibility(VARCHAR, 'private' | 'friends' | 'public')is_starred(BOOLEAN)created_at(TIMESTAMP WITH TIME ZONE)updated_at(TIMESTAMP WITH TIME ZONE)memact_app_permissions (app category access grants):
id(UUID, primary key)user_id(UUID)app_id(VARCHAR)category(VARCHAR)allowed_visibility(VARCHAR)granted_at(TIMESTAMP WITH TIME ZONE)Work to Do
Create a new adapter
src/adapters/postgresql.mjsutilizingpg(node-postgres) with connection pooling.Implement the
load()andsave(store)methods matching the storage contract insrc/storage.mjs.Create a SQL installation/migration script
database/migration_v1.sqlcontaining table definitions and constraints.Add unit tests in
test/adapters/postgresql.test.mjsverifying connection, query retrieval, and update operations.Document database setup and configuration in
README.md.Acceptance Criteria
PostgreSQL adapter can be initialized and loaded via connection string/URL configuration.
Storage reads/writes successfully persist to PostgreSQL.
All existing Memory engine tests pass with the database adapter loaded.
SSoC26 Contributor Notice:
Since this repository (
Memact/Memory) is outside the mainContextrepository, and the registered project for tracking contributions is specifically Context (Memact/Context), please make sure to create a dummy PR in the Context repository linking to your actual PR or commits in this repository. This is required for your contribution to be correctly tracked and counted.If you have already created a dummy PR in
Memact/Contextlinking to your work here, please ignore this message!