Skip to content

Commit 3f0e5e9

Browse files
committed
Added Pluggable VectorDBs and Postgresql support
1 parent 9e51f32 commit 3f0e5e9

7 files changed

Lines changed: 709 additions & 176 deletions

File tree

.env.example

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,29 @@ OM_PORT=8080
33
OM_API_KEY=your-secret-api-key-here
44
OM_MODE=standard # standard | langgraph
55

6-
# Database
6+
# Metadata Store
7+
# sqlite (default) | postgres
8+
OM_METADATA_BACKEND=sqlite
79
OM_DB_PATH=./data/openmemory.sqlite
810

11+
# PostgreSQL Settings (used when OM_METADATA_BACKEND=postgres or OM_VECTOR_BACKEND=pgvector)
12+
OM_PG_HOST=localhost
13+
OM_PG_PORT=5432
14+
OM_PG_DB=openmemory
15+
OM_PG_USER=postgres
16+
OM_PG_PASSWORD=postgres
17+
OM_PG_SCHEMA=public
18+
OM_PG_TABLE=openmemory_memories
19+
OM_PG_SSL=disable # disable | require
20+
21+
# Vector Store Backend
22+
# sqlite (default) | pgvector | weaviate
23+
OM_VECTOR_BACKEND=sqlite
24+
OM_VECTOR_TABLE=openmemory_vectors
25+
OM_WEAVIATE_URL=
26+
OM_WEAVIATE_API_KEY=
27+
OM_WEAVIATE_CLASS=OpenMemory
28+
929
# Embeddings Configuration
1030
# Available providers: openai, gemini, ollama, local, synthetic
1131
OM_EMBEDDINGS=openai

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,10 @@ The CLI binds to stdin/stdout using the same toolset shown above, so HTTP and st
283283
| Phase | Focus | Status |
284284
| ----- | ---------------------------------------------- | -------------- |
285285
| v1.0 | Core HMD backend (multi-sector memory) | ✅ Complete |
286-
| v1.1 | Python SDK + Node SDK | ✅ Complete |
286+
| v1.1 | Pluggable vector backends (pgvector, Weaviate) | ✅ Complete |
287287
| v1.2 | Dashboard (React) + metrics | ⏳ In progress |
288288
| v1.3 | Learned sector classifier (Tiny Transformer) | 🔜 Planned |
289289
| v1.4 | Federated multi-node mode | 🔜 Planned |
290-
| v1.5 | Pluggable vector backends (pgvector, Weaviate) | 🔜 Planned |
291290

292291
---
293292

backend/package-lock.json

Lines changed: 162 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212
"dotenv": "^16.4.5",
1313
"mammoth": "^1.11.0",
1414
"pdf-parse": "^2.4.3",
15+
"pg": "^8.16.3",
1516
"sqlite3": "^5.1.6",
1617
"turndown": "^7.2.1",
1718
"ws": "^8.18.3",
1819
"zod": "^3.23.8"
1920
},
2021
"devDependencies": {
2122
"@types/node": "^20.10.5",
23+
"@types/pg": "^8.15.5",
2224
"tsx": "^4.19.2",
2325
"typescript": "^5.6.3"
2426
}
25-
}
27+
}

backend/src/config/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@ export const env = {
2121
mode: (process.env.OM_MODE || 'standard').toLowerCase(),
2222
lg_namespace: process.env.OM_LG_NAMESPACE || 'default',
2323
lg_max_context: Number(process.env.OM_LG_MAX_CONTEXT) || 50,
24-
lg_reflective: (process.env.OM_LG_REFLECTIVE ?? 'true').toLowerCase() !== 'false'
24+
lg_reflective: (process.env.OM_LG_REFLECTIVE ?? 'true').toLowerCase() !== 'false',
25+
metadata_backend: (process.env.OM_METADATA_BACKEND || 'sqlite').toLowerCase(),
26+
vector_backend: (process.env.OM_VECTOR_BACKEND || 'sqlite').toLowerCase()
2527
}

0 commit comments

Comments
 (0)