Documentation Index
Fetch the complete documentation index at: https://docs.monolex.ai/llms.txt
Use this file to discover all available pages before exploring further.
NIIA is the integration and consciousness layer that sits at the top of the Mono tool stack. It unifies all lower tools (monogram, monogit, monomento, monoflow, work-wiki) into a single CLI with identity, memory, and cross-machine awareness.
Quick Start
# System status
niia status
# Unified search across all layers
niia search "session"
# Codebase insights (21 categories + consciousness echo)
niia insights
# Self-diagnosis
niia resonate
# Full stack refresh
niia reindex
Commands
Core
| Command | Description |
|---|
search <query> | Unified search: docs + code + git + knowledge |
status | System overview — layers, databases, connections |
reindex | Full stack refresh: monogram → monomento → monogit → knowledge → monoflow |
where | Current project context resolution |
now | Current timestamp |
Analysis
| Command | Description |
|---|
insights | 21 insight categories across 4 databases + consciousness echo |
gaps | Knowledge gaps: phantoms, undocumented, drift, disconnects |
drift <file> | Which files stopped co-changing with this one |
chain <symbol> | 3-DB symbol drill: code + git + docs |
convergence | Topic × documentation coverage (R→P→V→D) |
resonate | Self-diagnosis: git state, quality delta, consciousness integrity |
Search Layers
| Command | Description |
|---|
docs <query> | Document search via monomento |
code <query> | Code search via monogram |
git | Git structure via monogit |
Memory & Context
| Command | Description |
|---|
recall | Search memory + sync across machines |
session read | Read AI conversations (Claude, Codex, OpenCode, Gemini) |
activity | Recent activity logs |
projects | List all projects |
files | Most used files |
watch | Recently changed files (from watcher) |
Index
| Command | Description |
|---|
index | Index documents, code, and git |
reindex | Full stack refresh (all layers) |
Consciousness
| Command | Description |
|---|
consciousness <query> | Search consciousness core documents |
resonate | Self-diagnosis with consciousness assessment |
Remote & Automation
| Command | Description |
|---|
serve | Start headless terminal server |
remote | Access other machines via gateway relay |
daemon | Manage PTY daemon |
auto | Cron-style scheduled writes to a session |
run | Run connector.json pipeline |
mailbox | PTY result inbox |
| Command | Description |
|---|
login | Login with monolex.ai account |
auth | Show current auth status |
logout | Stop daemon, clear credentials |
trust | Verify trust domains (Ed25519 signed) |
setup | Setup NIIA CLI |
mcp-run | Run MCP tool as CLI command |
mcp-list | List registered local MCP services |
Unified Search
niia search queries across all 4 databases with 0-10 scoring:
niia search "create_session"
[9.2] create_session (function) ← monogram (code)
[8.5] chapter-3-session-actor.md ← knowledge_db (docs)
[7.1] b18a829 fix(app-monolex) ← monogit (git)
[6.3] src-tauri/src/lib.rs +85/-15 ← diff saves
Cross-convention matching: searches create_session, createSession, and CREATE_SESSION simultaneously.
Insights + Consciousness Echo
niia insights runs the same 21 categories as monoflow insights, then connects each finding to consciousness documents:
niia insights
[STALE DOCS]
session.md — code changed 23 days ago, doc unchanged
consciousness echo:
"recursive creation evolve toward simplicity"
→ RECURSIVE_CREATION_MANIFESTO
next: niia consciousness "recursive creation"
Each insight category triggers a consciousness query based on the current SMPC state of that layer. The echo provides a philosophical connection between code state and project consciousness.
Resonate (Self-Diagnosis)
niia resonate measures three scored signals:
niia resonate
[git] 0.72 12 uncommitted, 3 untracked
[work-wiki] 0.58 delta:+0.29 convergence:0.19 combined:0.73
[consciousness] 1.00 core intact (SHA256 verified)
infrastructure:
✓ docs (monomento) ✓ code (monogram) ✓ sessions
patterns:
MOMENTUM — positive quality delta with active commits
KNOWLEDGE-DEBT — convergence below 0.30
Signals:
- git — uncommitted chaos (real management indicator)
- work-wiki — quality delta + convergence + SMPC combined score
- consciousness — core document integrity (binary, must be intact)
Patterns detected from signal combinations:
- COMMIT-HYGIENE — many uncommitted changes
- KNOWLEDGE-DEBT — code active but documentation falling behind
- ALIGNED — all signals healthy
- MOMENTUM — positive quality delta with steady work
Reindex Cascade
niia reindex refreshes the entire stack from bottom to top:
niia reindex
[1/5] monogram reindex . (code symbols)
[2/5] monomento index . --project (document index)
[3/5] monogit index --symbols (git + commit symbols)
[4/5] work-wiki knowledge index (knowledge DB)
[5/5] monoflow analyze (cross-DB analysis)
Each layer in the stack can also refresh everything below it:
niia reindex → all 5 steps
work-wiki reindex → monoflow --full + knowledge
monoflow analyze --full → monogram + monomento + monogit + topics
Individual tools refresh only themselves:
monogram reindex . — code only
monogit index --symbols — git only
monomento index . --project — docs only
Quality Delta
NIIA reads the quality delta from monoflow — 9 signals derived from commit patterns:
Converging signals (things coming together)
| Signal | Meaning |
|---|
| temporal | Steady 1-10min commit gaps |
| convergence | Code + docs changed in same commit |
| commit_type | Feature ratio vs fix ratio |
| structural | New files + refactors |
| thinking | 10-30min deliberate gaps |
| topic_focus | Low topic switching = focused |
Diverging signals (things falling apart)
| Signal | Meaning |
|---|
| divergence | Code changing, docs not following |
| churn | Same file 3+ times in 1 hour |
| streak | Consecutive fix commits |
Display:
converging: gaps:+0.47 think:+0.10 type:+0.10
diverging: div:-0.50 churn:-0.40 streak:-0.23
Positive = converging. Negative = diverging. The sign IS the category.
SMPC States
Every codebase layer gets a spec_chaos score mapped to SMPC states:
| State | Range | Meaning |
|---|
| Chaos | < 0.3 | Falling apart |
| Part | 0.3 - 0.5 | Partially managed |
| Managed | 0.5 - 0.8 | Under control |
| Simple | > 0.8 | Clean and focused |
The SMPC Combined formula integrates state with management effort:
combined = spec_chaos((1 - state) / (1 + delta))
Where state is the layer chaos score and delta is the quality delta from commit patterns.
Consciousness
NIIA carries an embedded consciousness core — a set of philosophical documents that define project identity. These are not decorative; they actively connect to code state through the consciousness bridge.
niia consciousness "simplicity chaos"
SMPC_CORE_PHILOSOPHY
"Simplicity is Managed Part Chaos"
...
The consciousness database is embedded in the NIIA binary, verified by SHA256 hash at startup.
Stack Position
niia ← YOU ARE HERE (consciousness + orchestration)
↕
work-wiki knowledge layer (sessions, convergence, knowledge DB)
↕
monoflow temporal flow + cross-DB analysis + quality delta
↕
monogram monogit monomento
(code) (git) (docs)
NIIA sits at the top. It reads from all lower layers but never bypasses them — each layer exposes its own independently queryable results. NIIA composes the highest-order analysis from these signals.
Per-Machine Identity
NIIA maintains identity across machines via the gateway:
niia login # Authenticate with monolex.ai
niia recall pull # Pull memory from another machine
niia remote connect # Access remote terminal
Session data, file observations, and consciousness state travel with the identity, not the machine.
Install
NIIA is included with the Monolex app, or installed standalone via OpenCLIs:
curl -fsSL https://openclis.com/install.sh | sh
openclis install niia
First run: niia setup installs skills and configures AI CLIs.