fix(ts-sdk): make pg an optional, ranged peer dependency
mem0ai declared pg as a required peer pinned to exactly 8.11.3, so npm auto-installed it for every user (including hosted MemoryClient users) and failed with ERESOLVE in any project already on a newer pg. The pin existed because pgvector.ts imported pg at module load, so mem0ai/oss crashed without it. PGVector now loads pg through loadPeer on initialize(), like the other optional vector stores, which lets pg and @types/pg become optional ^8.11.x peers. @types/jest moves from peer to dev dependencies. Closes #3307
This commit is contained in:
@@ -5,6 +5,12 @@ description: "Use pgvector as a vector store in Mem0 for PostgreSQL-based vector
|
||||
|
||||
[pgvector](https://github.com/pgvector/pgvector) is an open-source vector similarity search extension for Postgres. After connecting to Postgres, run `CREATE EXTENSION IF NOT EXISTS vector;` to create the vector extension.
|
||||
|
||||
The TypeScript SDK loads the `pg` driver only when you use this store, so install it alongside `mem0ai`:
|
||||
|
||||
```bash
|
||||
npm install pg
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
Reference in New Issue
Block a user