2.0 KiB
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:
- Schemas define types and contracts (
schemas/kb/) - Defaults provide base values
- Mode overlays adjust for environment (dev/prod/test)
- User customization overrides for specific needs
- 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
- Nickel Schemas - Type definitions
- Configuration Guide - User documentation
- ADR-001: Nickel vs TOML - Decision rationale