{"_id":"@alineo-labs/postgres-memory","_rev":"3-dcdded207d49737a0caca33c2c32239f","name":"@alineo-labs/postgres-memory","dist-tags":{"latest":"0.2.2"},"versions":{"0.2.0":{"name":"@alineo-labs/postgres-memory","version":"0.2.0","license":"Apache-2.0","_id":"@alineo-labs/postgres-memory@0.2.0","maintainers":[{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"}],"homepage":"https://github.com/DrejT/alineo#readme","bugs":{"url":"https://github.com/DrejT/alineo/issues"},"dist":{"shasum":"d0d09ab797f8b83e678406d4acf4404f9fe1a484","tarball":"https://registry.npmjs.org/@alineo-labs/postgres-memory/-/postgres-memory-0.2.0.tgz","fileCount":4,"integrity":"sha512-DowJQnrSjOQHmZRuCJZZ0AoJGtNw2qgYU2GSvPz3HESr9SJwTiVUbPc1b9jkPG5qn9Fk61OEBvJcSoPd4uQGbw==","signatures":[{"sig":"MEUCIDQXTAlcNxHeW8V4SNTvh0NaSa7Oqql944eZnawae/+xAiEAw6crAwk5FclY8s4/2UUR6tygtEF4JNOOobCU6d7oJ54=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alineo-labs%2fpostgres-memory@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":26141},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"gitHead":"8bd54ff750438ee67b032d48e20abfade662099a","scripts":{"build":"tsdown"},"_npmUser":{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"},"repository":{"url":"git+https://github.com/DrejT/alineo.git","type":"git","directory":"packages/adapters/postgres-memory"},"_npmVersion":"10.9.8","description":"Shared, multi-process `@alineo-labs/memory` backend for [alineo](https://alineo.tech), via Postgres.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"postgres":"3.4.9","@alineo-labs/memory":"0.2.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"0.22.3","bun-types":"1.3.14","typescript":"6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/postgres-memory_0.2.0_1788102914827_0.4027266964338241","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@alineo-labs/postgres-memory","version":"0.2.1","license":"Apache-2.0","_id":"@alineo-labs/postgres-memory@0.2.1","maintainers":[{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"}],"homepage":"https://github.com/DrejT/alineo#readme","bugs":{"url":"https://github.com/DrejT/alineo/issues"},"dist":{"shasum":"4647718e9e791470299beabe59b2210433ed8ddd","tarball":"https://registry.npmjs.org/@alineo-labs/postgres-memory/-/postgres-memory-0.2.1.tgz","fileCount":4,"integrity":"sha512-YCp4ZhVIH8YJ5tyCUvhfTYO1fk1LqOAVMc01ZNVSk4zCBFLefoHobWs6kne7OsvihyS9PFhuLGTFasLCzouELg==","signatures":[{"sig":"MEUCIFqkgNk9EI+m6iMQr0q+/af0Fiomza4EIdLp8tRGRWznAiEA6oLum6PUxUX+BjtTsDe2uM7teHeH6XMQCsuLn6IPIcw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alineo-labs%2fpostgres-memory@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":26141},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"gitHead":"0a4efc6f2b7e9cc4b02acf303b2439788d55907c","scripts":{"build":"tsdown"},"_npmUser":{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"},"repository":{"url":"git+https://github.com/DrejT/alineo.git","type":"git","directory":"packages/adapters/postgres-memory"},"_npmVersion":"10.9.8","description":"Shared, multi-process `@alineo-labs/memory` backend for [alineo](https://alineo.tech), via Postgres.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"postgres":"3.4.9","@alineo-labs/memory":"0.2.1"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"0.22.3","bun-types":"1.3.14","typescript":"6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/postgres-memory_0.2.1_1788628601740_0.7295018054432454","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@alineo-labs/postgres-memory","version":"0.2.2","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/DrejT/alineo.git","directory":"packages/adapters/postgres-memory"},"type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","exports":{".":{"import":"./dist/index.mjs","types":"./dist/index.d.mts"}},"publishConfig":{"access":"public","provenance":true},"scripts":{"build":"tsdown"},"dependencies":{"@alineo-labs/memory":"0.2.2","postgres":"3.4.9"},"devDependencies":{"bun-types":"1.4.2","tsdown":"0.23.0","typescript":"6.0.3"},"_id":"@alineo-labs/postgres-memory@0.2.2","gitHead":"d3323f599d24aade22d8e26ed1ae695e1d236280","description":"Shared, multi-process `@alineo-labs/memory` backend for [alineo](https://alineo.tech), via Postgres.","bugs":{"url":"https://github.com/DrejT/alineo/issues"},"homepage":"https://github.com/DrejT/alineo#readme","_nodeVersion":"22.23.2","_npmVersion":"10.9.8","dist":{"integrity":"sha512-ha/yqQzRPZuQBnpjhcrhbRGBYuxrUuLNUxl02B3475mb0/rGbmXDLNvU3/mhV/88jY+0hop4i8ZnvbbcBtrLiA==","shasum":"449f6dce8c0aa4f99ef7c0d528145e931734be48","tarball":"https://registry.npmjs.org/@alineo-labs/postgres-memory/-/postgres-memory-0.2.2.tgz","fileCount":4,"unpackedSize":26079,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alineo-labs%2fpostgres-memory@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDyZjtg5iPgxWWeOVUD4g7rhIE+ZajJ6CHEW++C2kauqAIgZEZEePiaWTwRG9w6oCDeaEHOrg38cEbdidGcpmVamgo="}]},"_npmUser":{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"},"directories":{},"maintainers":[{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postgres-memory_0.2.2_1789325264583_0.20252883117931209"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-30T15:15:14.651Z","modified":"2026-09-13T18:47:45.035Z","0.2.0":"2026-08-30T15:15:14.979Z","0.2.1":"2026-09-05T17:16:41.875Z","0.2.2":"2026-09-13T18:47:44.720Z"},"bugs":{"url":"https://github.com/DrejT/alineo/issues"},"license":"Apache-2.0","homepage":"https://github.com/DrejT/alineo#readme","repository":{"type":"git","url":"git+https://github.com/DrejT/alineo.git","directory":"packages/adapters/postgres-memory"},"description":"Shared, multi-process `@alineo-labs/memory` backend for [alineo](https://alineo.tech), via Postgres.","maintainers":[{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"}],"readme":"# @alineo-labs/postgres-memory\n\nShared, multi-process `@alineo-labs/memory` backend for [alineo](https://alineo.tech), via Postgres.\n\n```bash\nbun add @alineo-labs/postgres-memory\n```\n\nFor local dev with zero infrastructure, use [`@alineo-labs/sqlite-memory`](https://github.com/DrejT/alineo/tree/main/packages/adapters/sqlite-memory) instead.\n\n---\n\n## Usage\n\n```ts\nimport { Memory } from \"@alineo-labs/memory\";\nimport {\n  PostgresWorkingMemoryProvider,\n  PostgresSemanticMemoryProvider,\n} from \"@alineo-labs/postgres-memory\";\n\nconst memory = new Memory({\n  workingMemory: new PostgresWorkingMemoryProvider(connectionString),\n  semantic: new PostgresSemanticMemoryProvider(connectionString, myEmbeddingProvider),\n});\n```\n\nMigrations run lazily on first query — no separate `connect()` step.\n\n## Team isolation\n\nRows carrying a `ResourceRef.teamId` are isolated via row-level security: every query runs\ninside a transaction that first sets `app.team_id` for that transaction, and each table's RLS\npolicy only allows access to rows where `team_id` is `NULL` or matches. `FORCE ROW LEVEL\nSECURITY` is set so this applies even to the role that owns the tables. See `src/migrations.ts`\nfor the exact policy.\n\n## Vector search\n\n`recall()` uses a real `pgvector` HNSW index whenever the connected Postgres instance allows\n`CREATE EXTENSION IF NOT EXISTS vector` (on by default on Supabase/Neon, allowlisted on RDS,\nunavailable on a bare Postgres with no superuser access) — falling back to an in-JS\ncosine-similarity scan over every row for the resource otherwise. Check\n`PostgresSemanticMemoryProvider.hasVectorIndex` to see which path is active; the plain `vector`\n(`double precision[]`) column on `alineo_semantic_memory` is always populated regardless, so the\nfallback is never a degraded schema, only a slower code path over the same data. The indexed\npath's own table (`alineo_semantic_vec`, created lazily once the embedding dimension is known)\ngets identical row-level-security policies to the primary table, so scoping doesn't depend on\nwhich path a given call takes.\n\nThis package has not been run against a live Postgres instance in this repo's own test suite\n(none is available here) — it ships type-checked, matching `@alineo-labs/postgres`'s own\ntesting posture, not integration-tested against a real server. That applies to this HNSW path\ntoo: it's implemented against `pgvector`'s documented SQL surface, not verified against a live\ninstance with the extension installed.\n\n---\n\n## License\n\nApache 2.0\n","readmeFilename":"README.md"}