← Back to Plugins
Voice

Memory Pgsql Cognee

thrytku By thrytku 👁 2 views ▲ 0 votes

OpenClaw memory plugin powered by PostgreSQL/pgvector and Cognee, with distilled-first recall and async knowledge refinement.一个基于 PostgreSQL/pgvector 和 Cognee 的 OpenClaw 记忆插件,支持 distilled-first recall 和异步知识提炼。

GitHub

README

# Memory PGSQL Cognee

`memory-pgsql-cognee` is an OpenClaw memory plugin backed by `PostgreSQL + pgvector`, with `Cognee` as an asynchronous knowledge-distillation layer.

For step-by-step installation, use [INSTALL.md](./INSTALL.md).

## What It Does

- Uses `PostgreSQL/pgvector` as the only live memory store
- Preserves the existing memory flow:
  - `distilled`
  - `session`
  - `full`
- Recalls memories in this order:
  - `distilled -> session -> full`
- Writes all runtime/session memories directly into PostgreSQL
- Queues async refinement jobs for Cognee
- Falls back to local LLM fact extraction if Cognee graph processing fails

## Runtime Dependencies

- PostgreSQL with `pgvector`
- Cognee HTTP API
- Embedding service at `embedding.serviceUrl`
- Ollama-compatible generation endpoint for fallback fact extraction

## Key Config

- `embedding.serviceUrl`
- `embedding.model`
- `enrichment.dbUrl`
- `enrichment.cogneeBaseUrl`
- `enrichment.ollamaBaseUrl`
- `enrichment.refinementModel`
- `enrichment.pollIntervalMs`

## Publish Notes

- This plugin is already decoupled from LanceDB-era helper scripts
- No synchronous bridge scripts are required for recall or write
- External state is limited to PostgreSQL and Cognee

## Repository Layout

- `index.js`: plugin runtime
- `openclaw.plugin.json`: plugin schema
- `sql/init_openclaw_memory_schema.sql`: schema bootstrap
- `tools/import_openclaw_memory.py`: markdown importer
- `tools/sync_md_to_pgsql.sh`: one-command markdown sync
- `tools/install_md_sync_timer.sh`: install `systemd --user` sync timer
- `tools/test_openclaw_memory_db.py`: PostgreSQL smoke test
- `tools/test_openclaw_cognee_stack.py`: Cognee queue/API smoke test
- `INSTALL.md`: install guide
- `docs/`: architecture and publishing notes
voice

Comments

Sign in to leave a comment

Loading comments...