kogral/.kb-config/README.md
Jesús Pérez 2b4d548aad
Some checks failed
Nickel Type Check / Nickel Type Checking (push) Has been cancelled
Rust CI / Security Audit (push) Has been cancelled
Rust CI / Check + Test + Lint (nightly) (push) Has been cancelled
Rust CI / Check + Test + Lint (stable) (push) Has been cancelled
chore: add ci defs files
2026-01-23 16:12:15 +00:00

2.0 KiB

KB Configuration

Configuration directory for Knowledge Base project using Nickel schemas.

Structure

.kb-config/
├── README.md           # This file
├── core/               # Core KB configuration
│   └── kb.ncl          # Main KB config
├── platform/           # Platform-specific configs
│   ├── dev.ncl         # Development mode
│   ├── prod.ncl        # Production mode
│   └── test.ncl        # Testing mode
└── targets/            # Target-specific configs (generated)
    ├── kb-cli.json
    ├── kb-mcp.json
    └── kb-core.json

Pattern

Follows the typedialog + provisioning pattern:

  1. Schemas define types and contracts (schemas/kb/)
  2. Defaults provide base values
  3. Mode overlays adjust for environment (dev/prod/test)
  4. User customization overrides for specific needs
  5. Composition merges layers using Nickel helpers

Usage

# Validate configuration
just nickel::validate .kb-config/core/kb.ncl

# Export to JSON for targets
nickel export --format json .kb-config/core/kb.ncl > .kb-config/targets/kb-core.json

# Use in Rust
let config = KbConfig::from_file(".kb-config/targets/kb-core.json")?;

Modes

Development (dev.ncl)

  • Filesystem storage only
  • Local embeddings (fastembed)
  • Debug logging
  • Fast iteration

Production (prod.ncl)

  • Hybrid storage (filesystem + SurrealDB)
  • Cloud embeddings (OpenAI/Claude)
  • Production logging
  • Performance optimized

Testing (test.ncl)

  • In-memory storage
  • No embeddings
  • Verbose logging
  • Test fixtures

Configuration Layers

Base Schema (contracts.ncl)
    ↓
Default Values (defaults.ncl)
    ↓
Mode Overlay (dev/prod/test)
    ↓
User Customization (kb.ncl)
    ↓
Exported JSON (targets/*.json)

See Also