Skip to content

Graph memory: Postgres schema + repo helpers (#48)#64

Merged
aurexav merged 1 commit intomainfrom
review/issue-48-graph-memory
Feb 19, 2026
Merged

Graph memory: Postgres schema + repo helpers (#48)#64
aurexav merged 1 commit intomainfrom
review/issue-48-graph-memory

Conversation

@aurexav
Copy link
Member

@aurexav aurexav commented Feb 19, 2026

Implements Graph Memory Postgres v1 schema and invariants.

  • Adds graph tables (entities, aliases, facts, fact_evidence) and wires them into schema bootstrap.
  • Adds storage helpers + ignored integration tests for temporal validity, evidence binding, and dedupe.
  • Updates specs and acceptance test DB reset to truncate new tables.

Verification:

  • cargo make fmt-rust-check
  • cargo make lint
  • cargo make test-rust
  • cargo make test-integration (local .env)
  • cargo make e2e (with ELF_QDRANT_HTTP_URL)

Closes #48

…gres graph memory schema","intent":"Implement issue 48 graph tables and repo helpers","impact":"Unblocks graph ingestion and correction work","breaking":false,"risk":"medium","refs":["gh:#48"]}
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 096459944c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


CREATE UNIQUE INDEX IF NOT EXISTS uq_graph_facts_active_entity_object
ON graph_facts (tenant_id, project_id, scope, subject_entity_id, predicate, object_entity_id)
WHERE valid_to IS NULL AND object_entity_id IS NOT NULL;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Enforce uniqueness for all active fact windows

The partial unique indexes only apply when valid_to IS NULL, so duplicate facts with the same (tenant, project, scope, subject, predicate, object) can still be inserted with bounded windows like valid_to > now. Those rows are considered active by fetch_active_facts_for_subject (valid_from <= now AND (valid_to IS NULL OR valid_to > now)), which violates the new one-active-fact invariant and can return conflicting active facts whenever finite validity ranges are used.

Useful? React with 👍 / 👎.

@aurexav aurexav merged commit 0964599 into main Feb 19, 2026
6 of 7 checks passed
@aurexav aurexav deleted the review/issue-48-graph-memory branch February 19, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Graph Memory: canonical entity/fact temporal schema in Postgres

1 participant