# RAG System Schema
# Retrieval-Augmented Generation with embeddings, vector DB, LLM

{
  RagConfig = {
    rag | {
      enabled | Bool,
    },

    embeddings | {
      provider | String,
      model | String,
      dimension | Number | optional,
      api_key | String | optional,
      batch_size | Number | optional,
    } | optional,

    vector_db | {
      db_type | String,
      url | String | optional,
      namespace | String | optional,
      database | String | optional,
      hnsw_m | Number | optional,
      hnsw_ef_construction | Number | optional,
    } | optional,

    llm | {
      provider | String,
      model | String,
      api_key | String | optional,
      api_url | String | optional,
      temperature | Number | optional,
      max_tokens | Number | optional,
    } | optional,

    retrieval | {
      top_k | Number | optional,
      similarity_threshold | Number | optional,
      reranking | Bool | optional,
      hybrid | Bool | optional,
      mmr_lambda | Number | optional,
    } | optional,

    ingestion | {
      auto_ingest | Bool | optional,
      watch_files | Bool | optional,
      chunk_size | Number | optional,
      overlap | Number | optional,
      doc_types | Array String | optional,
    } | optional,

    monitoring | {
      enabled | Bool | default = false,
    } | optional,

    logging | {
      level | String | default = "info",
    } | optional,
  },
}
