# Knowledge Base Core Configuration
#
# User customization layer - compose with mode overlays
# Pattern: defaults + mode + user_custom → final config

let contracts = import "../../schemas/kb/contracts.ncl" in
let defaults = import "../../schemas/kb/defaults.ncl" in
let helpers = import "../../schemas/kb/helpers.ncl" in

# Select mode overlay (dev, prod, or test)
let mode = import "../../schemas/kb/modes/dev.ncl" in

# User customizations (override defaults and mode)
let user_custom = {
  graph = {
    name = "knowledge-base",
    version = "1.0.0",
    description = "Personal knowledge base for the KB project",
  },

  # Example: Override inheritance base
  # inheritance = {
  #   base = "/Users/Akasha/Tools/.kb-shared",
  #   guidelines = [
  #     "/Users/Akasha/Tools/.claude/guidelines/rust",
  #   ],
  #   priority = 100,
  # },

  # Example: Use different embedding provider
  # embeddings = {
  #   provider = 'openai,
  #   model = "text-embedding-3-small",
  #   dimensions = 1536,
  # },

  # Example: Customize query behavior
  # query = {
  #   similarity_threshold = 0.5,
  #   max_results = 15,
  # },

  # Example: Enable SurrealDB for larger projects
  # storage = {
  #   secondary = {
  #     enabled = true,
  #     url = "ws://localhost:8000",
  #     namespace = "kb",
  #     database = "knowledge_base",
  #   },
  # },
} in

# Compose configuration: defaults + mode + user customizations
helpers.compose_config defaults.base mode user_custom
  | contracts.KbConfig
