Skip to content

GateWeave: Adaptive memory admission control with belief versioning#3

Merged
Sandeeprdy1729 merged 2 commits intomainfrom
copilot/implement-temporal-memory-architecture
Apr 2, 2026
Merged

GateWeave: Adaptive memory admission control with belief versioning#3
Sandeeprdy1729 merged 2 commits intomainfrom
copilot/implement-temporal-memory-architecture

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

TIMPs stores every memory indiscriminately, leading to storage bloat, degraded retrieval precision, and no mechanism for tracking evolving user beliefs. Contradictions are caught post-hoc with no versioning, so outdated positions silently propagate into downstream tools.

GateWeave adds write-time admission gating and belief versioning to the memory pipeline.

Core service (core/gateWeave.ts)

  • 5-dimensional admission scoring: utility (embedding overlap with recent context), confidence (importance + concreteness), novelty (cosine distance to existing), recency (temporal decay), tool-relevance (keyword match against TIMPs tools)
  • 3-tier gating: admit (≥0.45 → full PG+Qdrant store), summarize (≥0.25 → compressed summary), discard (<0.25 → skip)
  • Belief versioning: position-like statements create versioned nodes with parent chain linking and status tracking (active/superseded/retracted)
  • Proactive propagation: high-impact belief changes flag burnout baselines and relationship health for recomputation

Write-time integration (memory/memoryIndex.ts)

const admission = await gateWeave.evaluateMemory(userId, projectId, content, ...);
if (admission.decision === 'discard') return null;
if (admission.decision === 'summarize') {
  await gateWeave.summarizeAndLink(userId, projectId, content, tags);
  return null;
}
// admit path: store normally, then propagate if belief was versioned

Falls back to unconditional storage if GateWeave fails.

Schema (db/gateWeaveDb.ts)

  • belief_versions — versioned belief chains with parent links, confidence, contradiction refs
  • gateweave_decisions — admission audit log with score breakdowns
  • gateweave_summaries — compressed rollups for medium-value gated content

Tool 18 (tools/gateWeaveTool.ts)

Operations: stats, list_beliefs, belief_history, tune_weights — exposes admission metrics and belief chains to the agent and user.

Integration touchpoints

  • toolRouter.ts — keyword patterns + LLM routing for gateweave
  • agent.ts — system prompt updated (17→18 tools)
  • server.ts / seed.ts — table initialization
  • tools/index.ts — tool registration

Copilot AI and others added 2 commits April 2, 2026 07:20
…oning

- Add GateWeave database tables (belief_versions, gateweave_decisions, gateweave_summaries)
- Add core GateWeave service with multi-dimensional admission scoring
- Integrate write-time gating into memoryIndex.storeMemory
- Add belief versioning for position-like statements
- Add proactive propagation to burnout/relationship tools
- Add GateWeave tool for stats, belief listing, history, weight tuning
- Register GateWeave in tool router, agent system prompt, and tool registry
- Add DB init to server.ts and seed.ts

Agent-Logs-Url: https://github.com/Sandeeprdy1729/timps/sessions/0096f18f-eea6-48f1-8e32-8fec5c3a1fe8

Co-authored-by: Sandeeprdy1729 <182460780+Sandeeprdy1729@users.noreply.github.com>
…numbers as constants

Agent-Logs-Url: https://github.com/Sandeeprdy1729/timps/sessions/0096f18f-eea6-48f1-8e32-8fec5c3a1fe8

Co-authored-by: Sandeeprdy1729 <182460780+Sandeeprdy1729@users.noreply.github.com>
@Sandeeprdy1729 Sandeeprdy1729 marked this pull request as ready for review April 2, 2026 07:29
@Sandeeprdy1729 Sandeeprdy1729 merged commit 77fd6ec into main Apr 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants