modcomms/backend/alembic/versions
michael 9e2473c3e9 Add Knowledge Base management system for AI agent specs
Full-stack implementation enabling UI-driven management of the 5 AI agent knowledge bases
(Legal, Brand Barclays, Brand Barclaycard, Channel Best Practices, Channel Tech Specs).

Backend:
- 4 new DB models: KnowledgeBase, SourceDocument, SpecVersion, ProcessingJob
- Migration 006: creates tables, seeds 5 KB rows, imports existing prompts/*.md as v1 specs
- KnowledgeBaseRepository with full CRUD for all 4 tables
- LlamaParseService for document parsing, KnowledgeBaseService for pipeline orchestration
- ReferenceDocsService updated with DB-backed spec loading + cache invalidation
- 11 REST endpoints under /api/knowledge-base (list, detail, upload, delete, process, job status, versions, diff, activate)
- StorageService extended with KB document storage

Frontend:
- TypeScript types for all KB entities (KnowledgeBaseListItem, SourceDocument, ProcessingJob, SpecVersion, DiffResult)
- ApiService methods for all KB endpoints including multipart file upload
- KnowledgeBase component with 3-level UI: agent grid, detail view (documents + versions tabs), diff viewer
- Drag-and-drop file upload, processing progress bar with 3s polling, version comparison
- KnowledgeBaseIcon + Sidebar nav item with adminOnly filtering

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-12 15:00:36 -06:00
..
001_initial_schema.py permissions changes 2025-12-18 16:51:27 +00:00
002_seed_dropdown_options.py Seed database with agencies, brand guidelines, and dropdown options 2025-12-18 17:16:23 -06:00
003_add_meta_proof_types.py Add proof types for Meta sub-channel 2026-01-08 10:07:28 -06:00
004_cleanup_duplicate_dropdown_options.py Add migration to cleanup duplicate dropdown options 2026-01-23 13:22:44 -06:00
005_add_file_hash.py Fix migration down_revision to correct revision ID 2026-01-25 10:18:11 -06:00
006_add_knowledge_base.py Add Knowledge Base management system for AI agent specs 2026-02-12 15:00:36 -06:00