from core_db import AuditMixin, Base, EntityMixin from core_shared import JSONValue from sqlalchemy import String, Text from sqlalchemy import JSON from sqlalchemy.orm import Mapped, mapped_column class KnowledgeBase(EntityMixin, AuditMixin, Base): __tablename__ = "knowledge_base" code: Mapped[str] = mapped_column(String(64), index=True) name: Mapped[str] = mapped_column(String(128)) description: Mapped[str | None] = mapped_column(Text, nullable=True) status: Mapped[str] = mapped_column(String(32), default="active", index=True) metadata_json: Mapped[dict[str, JSONValue] | None] = mapped_column(JSON, nullable=True)