feat: add PostgreSQL memory store backend with pgvector + pg_textsearch#224
Open
Dontpushme wants to merge 4 commits into
Open
feat: add PostgreSQL memory store backend with pgvector + pg_textsearch#224Dontpushme wants to merge 4 commits into
Dontpushme wants to merge 4 commits into
Conversation
- Add PgMemoryStore implementing IMemoryStore interface - Support L0/L1 CRUD, vector search, BM25 full-text search, hybrid RRF - Add pgvector (HNSW/IVFFlat/DiskANN) and vectorscale StreamingDiskANN - Add pg_textsearch BM25 index with configurable text configuration - Add SQLite-to-PostgreSQL migration CLI tool - Extend config.ts, factory.ts, manifest.ts for postgres backend - Add openclaw.plugin.json schema for postgres config - Add integration tests (opt-in via TDAI_POSTGRES_TEST=1) - Update README.md and README_CN.md with PostgreSQL usage docs
Collaborator
|
Thanks for your attention! We will review and comment as soon as possible! |
- Add memory-tencentdb skill directory with SKILL.md, HTTP client, and gateway launcher - Add install-codebuddy-skill.sh with interactive and CLI modes - Add pack.sh to bundle skill + T-A-M Gateway into distributable zip - Add memory-client.mjs: zero-dependency Gateway HTTP client - Add gateway-up.sh: idempotent Gateway auto-start - Add config postgres subcommand to ctl.sh for PG + pgvector backend - Support PG text-config option for Chinese tokenization (simple/jieba)
…e options - First interactive step now asks for storage backend: SQLite / PostgreSQL / Skip - SQLite works out-of-the-box with zero external dependencies - PostgreSQL path adds Chinese tokenization config (simple/jieba) - Rewrite config writing to handle both backends - Sync standalone install script with same flow
…rch failures
When using Ollama as the embedding provider (e.g. bge-m3), the model is
unloaded from memory after 5 minutes of inactivity (Ollama default).
Subsequent embedding requests trigger a cold-start that takes 10-15s to
reload the model from disk. Since both the Gateway embedding layer and
the memory-client had a 10s timeout, search-memories and
search-conversations would consistently fail with 'request timed out'
after any idle period.
Root cause chain:
memory-client.mjs (10s timeout)
-> Gateway /search/memories
-> embeddingService.embed() (10s timeout)
-> Ollama /v1/embeddings (bge-m3)
-> model cold-start ~13.7s => AbortError
Changes:
- src/core/store/embedding.ts: raise DEFAULT_API_TIMEOUT_MS from 10s to
30s so the Gateway does not abort embedding requests during cold-starts
- codebuddy-plugin/.../memory-client.mjs: raise DEFAULT_TIMEOUT_MS from
10s to 30s for search commands; raise RECALL_TIMEOUT_MS from 3s to 5s
(recall still degrades gracefully on timeout)
- codebuddy-plugin/.../gateway-up.sh: add warmup_embedding() that fires
an async background request to Ollama /api/embed with keep_alive=30m
on every gateway-up, pre-loading the model before the first real
search and extending the model residence from 5m to 30m
Before fix: search-memories/search-conversations timeout every time
after 5+ minutes of idle (~100% failure rate)
After fix: first search completes in <0.5s when warmed up; even without
warmup, cold-start completes within the new 30s ceiling instead of
being killed at 10s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description | 描述
Related Issue | 关联 Issue
Change Type | 修改类型
Self-test Checklist | 自测清单
Additional Notes | 其他说明