feat(pegas-memory): Tier-1 self-improvement tools (commit + staleness)

- memory_commit: closes the 'commit hole' — writes verified answers from
  closed gaps back into atoms (mandatory dedup); leaves gap open if no
  verified answer exists. Reads verified status from PostgreSQL (source of
  truth), not the Qdrant projection.
- memory_stale: staleness guard with two signals — content-staleness
  (re-fetch + LLM verdict, needs proxy for foreign sites) and age-staleness
  (proxy-free fallback by pm_document.fetched_at, max_age_days).
- db: populate pm_document.fetched_at on upsert (freshness signal).
- docs: README/AGENTS/ARCHITECTURE/EXAMPLES updated (18 tools).
- self_improve.py: new module (227 lines).
This commit is contained in:
n1kt4r committed 2026-10-15 22:06:30 +05:00
1 parent a4c4a766c1
commit eca8a11e23
8 files changed
+439 -6

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
# Pegas Memory — Architecture
Pegas Memory is the long-term memory and knowledge base for the **Pegas** research agent.
It is a Python service exposed to the agent as an **MCP server** (16 tools).
It is a Python service exposed to the agent as an **MCP server** (18 tools).
---
@@ -14,7 +14,7 @@ It is a Python service exposed to the agent as an **MCP server** (16 tools).
└───────────────────┬──────────────────────┘
│ JSON-RPC 2.0 / stdio
┌───────────────────▼──────────────────────┐
│ mcp_server.py (tool layer, 16 tools) │
│ mcp_server.py (tool layer, 18 tools) │
└───────────────────┬──────────────────────┘
│ Python API
┌────────────────────────────┼────────────────────────────┐