zndx/gaius

2

stars

829

commits

Python

primary language

Sep 8, 2026

updated

zndx.github.io/gaius/

README

Gaius

A terminal interface for navigating graph-oriented data domains. Projects high-dimensional embeddings onto a 19×19 grid.

Gaius TUI

Overview

Gaius renders knowledge bases and document collections as spatial layouts, using topological data analysis to identify structural patterns. The interface combines a Go board metaphor with orthographic projections and multi-agent analysis.

Named after Gaius Plinius Secundus (Pliny the Elder).

Philosophy

The Gaius Project deliberately supports continuous agent collaboration at every level. Dynamic agent interaction spans all components: from knowledge base analysis with local SLM swarms, to operations-oriented agents powered by special purpose models (Orchestrator-8B, Magma-8B), to periodic content-informed reasoning and reflection.

This extends to long-term codebase development itself, in collaboration with Claude Code. This is a deliberate departure from the traditional paradigm where software is developed to a point release, then packaged for end users. Gaius is intended to be cloned, not packaged—engineered to provide a foundation for agent collaboration in any knowledge domain, such that the codebase and model suite can be adaptively co-developed in situ through Rapid Agent Systems Engineering (RASE).

Central to RASE is intrinsic verifiability: the operational environment itself serves as the verification oracle, enabling autonomous capability development without external labeling dependencies.

Prerequisites

  • Python 3.12+
  • uv package manager
  • PostgreSQL 16
  • Qdrant vector database
  • Optional: vLLM + optillm for local inference

Installation

git clone https://github.com/zndx/gaius.git
cd gaius

# Using devenv (recommended)
devenv shell

# Or with uv
uv sync --extra search --extra tda --extra inference

Configuration

Uses HOCON configuration with environment variable overrides.

# Required
export DATABASE_URL="postgres://localhost:5444/zndx_gaius?sslmode=disable"

# Optional inference
export OPTILLM_API_KEY="sk-optillm"
export GAIUS_OFFLINE="false"

See config/base.conf for full configuration options.

Security: gRPC Gateway Architecture

Gaius enforces a secure-by-default inference architecture. All inference requests route through the gRPC engine, which serves as the control plane for:

  • Authentication and authorization
  • Audit logging
  • Resource management and rate limiting

All clients (TUI, CLI, MCP) connect to the engine via gRPC. The engine must be running for any client to function.

Usage

# Run database migrations
dbmate -d db/migrations up

# Start TUI
uv run gaius

# CLI mode
uv run gaius-cli --cmd "/state" --format json

Key Bindings

KeyAction
hjklNavigate grid cursor
gCycle center panels (Graph → Think → Evolve → Observe)
vCycle view modes
oCycle overlays
[Toggle left panel (FileTree)
]Toggle right panel (Info)
\Toggle both side panels
/Enter command mode
?Show help
qQuit

FileTree (Left Panel)

KeyAction
Navigate tree items
EnterOpen selected file
SpaceExpand/collapse folder
GJump to last item (expands folders to find deepest leaf)
Ctrl-FPage down (half page)
Ctrl-BBPage up (half page) — requires double-press, known bug

Editor Panel (Normal Mode)

Vim-style modal editing for KB files.

KeyAction
iInsert at cursor
IInsert at line beginning
aAppend after cursor
AAppend at line end
oOpen line below
OOpen line above
ESCExit insert mode → normal mode
:qClose editor
:wqSave and close (auto-saves, so same as :q)
:<number>Go to line number (e.g., :42)
:mv <path>Move file to path
:rename [name]Move to scratch with optional name

Editor Panel (Navigation)

Works in both normal and insert modes.

KeyAction
Scroll viewport (browser-style)
Ctrl-FPage down
Ctrl-BPage up
GJump to end of document
hjklPass through to main grid (normal mode only)

Commands

CommandDescription
/search <query>Search KB files and content
/research <topic>Web search + LLM synthesis to KB
/explain [pos]Explain grid position with differential geometry (saves to KB)
/domain <name>Set domain focus
/swarm [domain]Run multi-agent analysis
/summaryGenerate daily summary
/activityView activity log
/tdaShow topological features
/reindexRefresh embeddings
/ambient statusShow ambient workload daemon status
/ambient startStart ambient background processing
/ambient stopStop ambient background processing
/ambient bufferExport buffered content to zettelkasten note
/gpu statusShow GPU endpoint status
/healthRun health diagnostics
/health fix <svc>Auto-remediate unhealthy service

Layout

┌─────────┬──────────────┬───────┬─────────┬──────────┐
│ Agents  │              │ Embed │ Graph/  │   Info   │
│ ─────── │  19×19 Grid  │  9×9  │ Think   │          │
│ Files   │              ├───────┤         │          │
│         │              │  Iso  │         │          │
│         │              │  9×9  │         │          │
│         ├──────────────┴───────┴─────────┤          │
│         │         Content / Edit         │          │
├─────────┴────────────────────────────────┴──────────┤
│ / Command                                           │
└─────────────────────────────────────────────────────┘

Features

Grid Visualization

  • KB entries projected onto 19×19 board via UMAP
  • View modes: Go, Theta, Swarm
  • Overlays: Risk, H1/H2 homology, Agents, Temporal

Orthographic Mini-Grids (9×9)

  • Embed view: Cosine similarity spotlight around cursor document
  • Iso view: Ricci curvature elevation map (boundaries vs interiors)
  • Unicode block visualization (█▓▒░·) for spatial intuition

Differential Geometry

  • Ricci curvature computation on semantic manifold
  • Visual interpretation: bright Embed + low Iso = cluster core
  • /explain generates LLM interpretations saved as KB notes
  • Captures mini-grid snapshots in zettelkasten format

Multi-Agent Analysis

  • 7 specialized agents (Leader, Risk, Optimizer, Planner, Critic, Executor, Adversary)
  • Parallel execution with consensus synthesis

Knowledge Base

  • Zettelkasten-style organization
  • Wikilink support ([[links]])
  • Markdown rendering

Topological Analysis

  • Persistent homology computation
  • H0 (components), H1 (loops), H2 (voids)
  • Visual overlay on grid

Architecture

src/gaius/
├── app.py              # TUI application
├── cli.py              # Non-interactive CLI
├── mcp_server.py       # MCP server for Claude Code integration
├── core/
│   ├── config.py       # HOCON configuration
│   ├── state.py        # Application state
│   ├── projection.py   # UMAP grid projection
│   ├── tda.py          # Topological data analysis
│   ├── geometry.py     # Ricci curvature computation
│   ├── minigrids.py    # 9×9 orthographic views
│   └── kb_capture.py   # Zettelkasten note generation
├── agents/             # Swarm roles and orchestration
├── inference/          # LLM client, synthesis, embeddings
├── widgets/            # Grid, panels, command input
└── awareness/          # Situational reports

MCP Server

Gaius includes an MCP server for integration with Claude Code and other MCP clients.

# Run MCP server
uv run gaius-mcp

Key Tools:

  • search_kb, read_kb, create_kb - Knowledge base operations
  • explain_grid_position - Differential geometry explanation with KB capture
  • run_swarm - Multi-agent analysis
  • semantic_search - Vector similarity search
  • research_topic - Web search + LLM synthesis

See src/gaius/mcp_server.py for full tool list.

Development

uv run gaius              # Run TUI
uv run pytest             # Run tests
mdbook build docs         # Build documentation

License

Apache License 2.0

Copyright 2025 Ryan Hill and Zndx Limited

Contributors

rch

829 commits

zndx/gaius

2

stars

829

commits

Python

primary language

Sep 8, 2026

updated

zndx.github.io/gaius/

README

Gaius

A terminal interface for navigating graph-oriented data domains. Projects high-dimensional embeddings onto a 19×19 grid.

Gaius TUI

Overview

Gaius renders knowledge bases and document collections as spatial layouts, using topological data analysis to identify structural patterns. The interface combines a Go board metaphor with orthographic projections and multi-agent analysis.

Named after Gaius Plinius Secundus (Pliny the Elder).

Philosophy

The Gaius Project deliberately supports continuous agent collaboration at every level. Dynamic agent interaction spans all components: from knowledge base analysis with local SLM swarms, to operations-oriented agents powered by special purpose models (Orchestrator-8B, Magma-8B), to periodic content-informed reasoning and reflection.

This extends to long-term codebase development itself, in collaboration with Claude Code. This is a deliberate departure from the traditional paradigm where software is developed to a point release, then packaged for end users. Gaius is intended to be cloned, not packaged—engineered to provide a foundation for agent collaboration in any knowledge domain, such that the codebase and model suite can be adaptively co-developed in situ through Rapid Agent Systems Engineering (RASE).

Central to RASE is intrinsic verifiability: the operational environment itself serves as the verification oracle, enabling autonomous capability development without external labeling dependencies.

Prerequisites

  • Python 3.12+
  • uv package manager
  • PostgreSQL 16
  • Qdrant vector database
  • Optional: vLLM + optillm for local inference

Installation

git clone https://github.com/zndx/gaius.git
cd gaius

# Using devenv (recommended)
devenv shell

# Or with uv
uv sync --extra search --extra tda --extra inference

Configuration

Uses HOCON configuration with environment variable overrides.

# Required
export DATABASE_URL="postgres://localhost:5444/zndx_gaius?sslmode=disable"

# Optional inference
export OPTILLM_API_KEY="sk-optillm"
export GAIUS_OFFLINE="false"

See config/base.conf for full configuration options.

Security: gRPC Gateway Architecture

Gaius enforces a secure-by-default inference architecture. All inference requests route through the gRPC engine, which serves as the control plane for:

  • Authentication and authorization
  • Audit logging
  • Resource management and rate limiting

All clients (TUI, CLI, MCP) connect to the engine via gRPC. The engine must be running for any client to function.

Usage

# Run database migrations
dbmate -d db/migrations up

# Start TUI
uv run gaius

# CLI mode
uv run gaius-cli --cmd "/state" --format json

Key Bindings

KeyAction
hjklNavigate grid cursor
gCycle center panels (Graph → Think → Evolve → Observe)
vCycle view modes
oCycle overlays
[Toggle left panel (FileTree)
]Toggle right panel (Info)
\Toggle both side panels
/Enter command mode
?Show help
qQuit

FileTree (Left Panel)

KeyAction
Navigate tree items
EnterOpen selected file
SpaceExpand/collapse folder
GJump to last item (expands folders to find deepest leaf)
Ctrl-FPage down (half page)
Ctrl-BBPage up (half page) — requires double-press, known bug

Editor Panel (Normal Mode)

Vim-style modal editing for KB files.

KeyAction
iInsert at cursor
IInsert at line beginning
aAppend after cursor
AAppend at line end
oOpen line below
OOpen line above
ESCExit insert mode → normal mode
:qClose editor
:wqSave and close (auto-saves, so same as :q)
:<number>Go to line number (e.g., :42)
:mv <path>Move file to path
:rename [name]Move to scratch with optional name

Editor Panel (Navigation)

Works in both normal and insert modes.

KeyAction
Scroll viewport (browser-style)
Ctrl-FPage down
Ctrl-BPage up
GJump to end of document
hjklPass through to main grid (normal mode only)

Commands

CommandDescription
/search <query>Search KB files and content
/research <topic>Web search + LLM synthesis to KB
/explain [pos]Explain grid position with differential geometry (saves to KB)
/domain <name>Set domain focus
/swarm [domain]Run multi-agent analysis
/summaryGenerate daily summary
/activityView activity log
/tdaShow topological features
/reindexRefresh embeddings
/ambient statusShow ambient workload daemon status
/ambient startStart ambient background processing
/ambient stopStop ambient background processing
/ambient bufferExport buffered content to zettelkasten note
/gpu statusShow GPU endpoint status
/healthRun health diagnostics
/health fix <svc>Auto-remediate unhealthy service

Layout

┌─────────┬──────────────┬───────┬─────────┬──────────┐
│ Agents  │              │ Embed │ Graph/  │   Info   │
│ ─────── │  19×19 Grid  │  9×9  │ Think   │          │
│ Files   │              ├───────┤         │          │
│         │              │  Iso  │         │          │
│         │              │  9×9  │         │          │
│         ├──────────────┴───────┴─────────┤          │
│         │         Content / Edit         │          │
├─────────┴────────────────────────────────┴──────────┤
│ / Command                                           │
└─────────────────────────────────────────────────────┘

Features

Grid Visualization

  • KB entries projected onto 19×19 board via UMAP
  • View modes: Go, Theta, Swarm
  • Overlays: Risk, H1/H2 homology, Agents, Temporal

Orthographic Mini-Grids (9×9)

  • Embed view: Cosine similarity spotlight around cursor document
  • Iso view: Ricci curvature elevation map (boundaries vs interiors)
  • Unicode block visualization (█▓▒░·) for spatial intuition

Differential Geometry

  • Ricci curvature computation on semantic manifold
  • Visual interpretation: bright Embed + low Iso = cluster core
  • /explain generates LLM interpretations saved as KB notes
  • Captures mini-grid snapshots in zettelkasten format

Multi-Agent Analysis

  • 7 specialized agents (Leader, Risk, Optimizer, Planner, Critic, Executor, Adversary)
  • Parallel execution with consensus synthesis

Knowledge Base

  • Zettelkasten-style organization
  • Wikilink support ([[links]])
  • Markdown rendering

Topological Analysis

  • Persistent homology computation
  • H0 (components), H1 (loops), H2 (voids)
  • Visual overlay on grid

Architecture

src/gaius/
├── app.py              # TUI application
├── cli.py              # Non-interactive CLI
├── mcp_server.py       # MCP server for Claude Code integration
├── core/
│   ├── config.py       # HOCON configuration
│   ├── state.py        # Application state
│   ├── projection.py   # UMAP grid projection
│   ├── tda.py          # Topological data analysis
│   ├── geometry.py     # Ricci curvature computation
│   ├── minigrids.py    # 9×9 orthographic views
│   └── kb_capture.py   # Zettelkasten note generation
├── agents/             # Swarm roles and orchestration
├── inference/          # LLM client, synthesis, embeddings
├── widgets/            # Grid, panels, command input
└── awareness/          # Situational reports

MCP Server

Gaius includes an MCP server for integration with Claude Code and other MCP clients.

# Run MCP server
uv run gaius-mcp

Key Tools:

  • search_kb, read_kb, create_kb - Knowledge base operations
  • explain_grid_position - Differential geometry explanation with KB capture
  • run_swarm - Multi-agent analysis
  • semantic_search - Vector similarity search
  • research_topic - Web search + LLM synthesis

See src/gaius/mcp_server.py for full tool list.

Development

uv run gaius              # Run TUI
uv run pytest             # Run tests
mdbook build docs         # Build documentation

License

Apache License 2.0

Copyright 2025 Ryan Hill and Zndx Limited

Contributors

rch

829 commits

Languages

Python

85.3%

PLpgSQL

6.6%

Gherkin

2.6%

Rust

1.7%

JavaScript

1.1%