openclaw - 💡(How to fix) Fix Support PostgreSQL/pgvector as a memory search store driver

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Running OpenClaw with a PostgreSQL database containing ~15,000 semantic embeddings (entity facts, lessons, events, research) via pgvector. The memory search SQLite index has ~1,100 chunks from memory files and session transcripts. Having both systems queryable through a single memory_search call would significantly improve recall quality.

Root Cause

Running OpenClaw with a PostgreSQL database containing ~15,000 semantic embeddings (entity facts, lessons, events, research) via pgvector. The memory search SQLite index has ~1,100 chunks from memory files and session transcripts. Having both systems queryable through a single memory_search call would significantly improve recall quality.

RAW_BUFFERClick to expand / collapse

Feature Request

Problem

The memory search system currently only supports SQLite as its store driver (agents.defaults.memorySearch.store.driver is const: "sqlite"). For deployments that already run PostgreSQL with pgvector for other embedding/vector search needs, this creates two parallel vector systems that don't share data:

  1. OpenClaw memory search (SQLite) — indexes memory files and session transcripts
  2. Application-level embeddings (PostgreSQL/pgvector) — entity facts, lessons, events, research, etc.

The memory_search tool only queries the SQLite index, missing all the PostgreSQL-stored knowledge. Meanwhile, custom hooks/plugins that query PostgreSQL can't benefit from OpenClaw's hybrid BM25+vector search pipeline.

Proposed Solution

Add PostgreSQL/pgvector as a supported store.driver option alongside SQLite. This would allow deployments to:

  • Unify all vector embeddings in a single PostgreSQL database
  • Query both memory files and application data through the memory_search tool
  • Leverage PostgreSQL's mature backup, replication, and monitoring infrastructure
  • Use pgvector's HNSW/IVFFlat indexes for larger-scale deployments

Alternatives Considered

  • Markdown export bridge: Periodically dump PostgreSQL data into markdown files for OpenClaw to index. Works but creates stale snapshots and doubles storage.
  • extraPaths with generated files: Similar, uses memorySearch.extraPaths to point at exported markdown. Same staleness issue.
  • Custom turn-context plugins: Inject PostgreSQL data per-turn. Works for proactive recall but doesn't surface through the memory_search tool when the agent explicitly searches.

Context

Running OpenClaw with a PostgreSQL database containing ~15,000 semantic embeddings (entity facts, lessons, events, research) via pgvector. The memory search SQLite index has ~1,100 chunks from memory files and session transcripts. Having both systems queryable through a single memory_search call would significantly improve recall quality.

Environment

  • OpenClaw version: 2026.5.7
  • PostgreSQL 16 with pgvector
  • Current memory search provider: Ollama (mxbai-embed-large)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING