Skip to content

Add bank deletion support #2

Description

@josharsh

Summary

Banks can be created with createBank() and listed with listBanks(), but there's no way to delete a bank and all its associated data.

What needs to happen

  1. Add a deleteBank(bankId: string) method to the Engram class
  2. It should delete all facts, entities, relations, and observations scoped to that bank
  3. Clean up FTS5 index entries for deleted facts
  4. Remove the bank row itself
  5. Prevent deletion of the default bank
  6. Add the method to MemoryStore first, then expose through Engram

Files to look at

  • src/store/store.ts — MemoryStore class, see existing createBank() and deleteFact() patterns
  • src/engram.ts — Engram orchestrator, exposes store methods
  • src/store/schema.ts — table definitions to understand relationships
  • tests/unit/store.test.ts — add tests here

Acceptance criteria

  • engram.deleteBank('my-bank') removes all scoped data
  • Throws if trying to delete the default bank
  • FTS5 index is cleaned up
  • Unit test covering create → populate → delete → verify empty

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions