Skip to content

Rename knowledge schema to memory; config reads DATABASE_URL - #32

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-6009-memory-schema
Aug 14, 2026
Merged

Rename knowledge schema to memory; config reads DATABASE_URL#32
TheGreatAxios merged 1 commit into
mainfrom
cl-6009-memory-schema

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

CL-6009 phase 1: renames the package's Postgres schema from knowledge to
memory, and switches config to read DATABASE_URL instead of
KNOWLEDGE_DATABASE_URL.

This is a safe pre-GA rename: no deployment has ever run migrations
against the knowledge schema, so there is no back-compat or migration
concern — the baseline migration SQL is edited in place rather than layered
with a new migration.

  • Postgres schema: knowledgememory (MEMORY_SCHEMA, memorySchema in
    src/db/schema.ts)
  • Drizzle table objects renamed for consistency: knowledgeDocument
    memoryDocument, knowledgeVersionmemoryVersion, knowledgeChunk
    memoryChunk, knowledgeEntitymemoryEntity, knowledgeEdge
    memoryEdge, knowledgeEmbedModelmemoryEmbedModel
  • arktype schema/type identifiers renamed to match: KnowledgeDocumentSchema
    MemoryDocumentSchema, KnowledgeVersion*MemoryVersion*,
    KnowledgeChunk*MemoryChunk*, KnowledgeEntity*MemoryEntity*,
    KnowledgeEdge*MemoryEdge*
  • loadMemoryConfig() now reads DATABASE_URL (hard cutover, no fallback to
    the old var name)
  • Baseline migration 0002_knowledge_baseline.sql edited in place and
    renamed to 0002_memory_baseline.sql (migrations are discovered/ordered
    by filename prefix, so the rename is safe); 0001_extensions.sql's
    CREATE SCHEMA statement updated too
  • Docs (README, AGENTS, PRODUCT, ARCHITECTURE, IMPLEMENTATION, CHANGELOG,
    docs/AUTHZ-DOCUMENT-ACCESS.md), .env.example, and compose.yml updated
    to match
  • Prose that uses "knowledge" as a generic domain word (not tied to the
    schema/identifier rename) was left alone

Test plan

  • bun run typecheck — passes
  • bun test ./src — 320 pass / 0 fail (fully mocked, no live Postgres
    required for this suite)

Pre-GA safe rename: no deployment has run migrations against the
`knowledge` schema yet, so this is a clean cutover with no back-compat
concerns. Postgres schema is now `memory`, table/type identifiers
(memoryDocument, MemoryEdgeHint, etc) follow suit, and loadMemoryConfig
reads DATABASE_URL instead of KNOWLEDGE_DATABASE_URL. Baseline
migration edited in place and renamed to 0002_memory_baseline.sql
since it has never run in production.
@TheGreatAxios
TheGreatAxios merged commit a1f8271 into main Aug 14, 2026
1 check passed
@TheGreatAxios
TheGreatAxios deleted the cl-6009-memory-schema branch August 14, 2026 03:46
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