Skip to content

EVA-127: knowledge embeddings + costs tables + migration#120

Merged
suzil merged 2 commits into
mainfrom
susannahjd/eva-127-knowledge-embeddings-costs-tables-migration
Mar 2, 2026
Merged

EVA-127: knowledge embeddings + costs tables + migration#120
suzil merged 2 commits into
mainfrom
susannahjd/eva-127-knowledge-embeddings-costs-tables-migration

Conversation

@suzil
Copy link
Copy Markdown
Owner

@suzil suzil commented Mar 2, 2026

Summary

  • Adds knowledge_embeddings table: packed Float32 BLOB vector per entry, content-hash dedup, ON DELETE CASCADE
  • Adds knowledge_costs table: per-API-call cost tracking for Voyage AI / OpenAI embedding calls
  • Adds updated_by + version columns to knowledge_entries via idempotent ALTER TABLE (try/catch, safe to re-run)

Test plan

  • Backend builds cleanly (cabal build ✅)
  • All 3 tables present after server startup
  • Existing knowledge_entries rows get updated_by = 'system', version = 1 defaults
  • Re-running migrations does not fail (idempotency via IF NOT EXISTS + try/catch)

Closes EVA-127

Made with Cursor

suzil added 2 commits March 1, 2026 18:04
Adds three new database artifacts to support the Phase 3 embedding pipeline:

- knowledge_embeddings table: stores packed Float32 BLOB vectors per entry,
  with content_hash for dedup and ON DELETE CASCADE for referential integrity
- knowledge_costs table: per-call cost tracking for Voyage AI / OpenAI calls,
  powering the cost summary in the Knowledge Library header (EVA-168)
- Idempotent ALTER TABLE: adds updated_by (provenance) and version (optimistic
  concurrency) columns to knowledge_entries via try/catch so re-runs are safe

Made-with: Cursor
@suzil suzil merged commit ca7c3ee into main Mar 2, 2026
2 of 4 checks passed
@suzil suzil deleted the susannahjd/eva-127-knowledge-embeddings-costs-tables-migration branch March 2, 2026 01:08
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.

1 participant