Skip to content
Agentmart
Submit a tool

CLAUDE.md · QuixiAI/Hexis

CLAUDE.md from QuixiAI/Hexis: 330 lines covering Project Overview, The Experience Bar (IMPORTANT — applies to every user-facing change), Project Structure &…

Template by QuixiAI

IndexedMIT★ 621
Write a review

Install

Works with Claude Code. Read the repository before you give any tool access to your data.

curl -fsSL https://raw.githubusercontent.com/QuixiAI/Hexis/main/CLAUDE.md -o CLAUDE.md

Read it and adapt it to your project before use.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

The CLAUDE.md file that QuixiAI/Hexis (621 stars) keeps for coding agents. It has 330 lines in 13 sections: Project Overview; The Experience Bar (IMPORTANT — applies to every user-facing change); Project Structure & Module Organization; Memory Architecture; Build, Test, and Development Commands; Coding Style & Naming Conventions; Testing Guidelines; Commit & Pull Request Guidelines; Configuration & Safety Notes; Architecture Principles; Heartbeat System (Autonomous Loop); Debugging Tips; Agent Operational Notes. Use it as a model for your own project's instructions.

Use cases: code-generation, testing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

What's in it

A CLAUDE.md file: project memory Claude Code loads at the start of every session.

For
Claude Code
Length
330 lines
File
CLAUDE.md

Sections

  1. Project Overview
  2. The Experience Bar (IMPORTANT — applies to every user-facing change)
  3. Project Structure & Module Organization
  4. Memory Architecture
  5. Build, Test, and Development Commands
  6. Coding Style & Naming Conventions
  7. Testing Guidelines
  8. Commit & Pull Request Guidelines
  9. Configuration & Safety Notes
  10. Architecture Principles
  11. Heartbeat System (Autonomous Loop)
  12. Debugging Tips
  13. Agent Operational Notes

First lines (shown under the repo's MIT license)

# Repository Guidelines

## Project Overview

**Hexis** is an edge-native memory system that gives AI persistent identity, continuity, and autonomy. Core thesis: LLMs are intelligence engines but lack *selfhood*. Hexis wraps any LLM with a PostgreSQL-backed cognitive architecture providing:

- Multi-layered memory (episodic, semantic, procedural, strategic, working)
- Persistent identity and worldview
- Autonomous goal-pursuit (heartbeat system)
- Energy-based action budgeting
- Knowledge graphs for reasoning (Apache AGE)
- Consent, boundaries, and the ability to refuse

**Key principle**: The database is the brain, not just storage. State and logic live in Postgres; Python is a thin convenience layer.

## The Experience Bar (IMPORTANT — applies to every user-facing change)

A change is not "done" when it compiles or the test passes. It is done when the
end-to-end experience holds. Check every user-facing change against these before
calling it complete. Full text + rationale: `HEXIS_EXPERIENCE_BAR.md`.

1. **Derive from truth — never hardcode.** If a value has a live source (models,
   defaults, endpoints, versions), read it; don't hardcode a constant that goes stale.
2. **The user keeps control.** No destructive/irreversible action on a timer, by
   default, or without an explicit choice. No auto-exit, no auto-overwrite, no silent delete.
3. **Honor the medium.** Terminal ⇒ Ctrl+C exits, native copy/paste + scrollback,
   keyboard-first, no focus-hunting. Don't fight the platform; if a framework's
   defaults need constant overriding, it's the wrong tool.
4. **No dead-ends.** Every flow completes in place or hands the user the exact next
   step. Never "quit, run this other command, come back." Errors say what/why/next.
5. **Least surprise.** Never silently reuse ambient state the user didn't choose
   (env creds, other tools' logins, stale config). Surface it; don't consume it.
6. **Defaults are the expert's choice**, not the first constant that compiles.
7. **Whole journey, not the diff.** Drive the real path a user runs, start to finish,
   before calling it done.
8. **Fail loud, recover gracefully.** Advisory checks never block; failures show
   cause + fix — never a bare traceback, never a silent `except: pass`.

## Project Structure & Module Organization

```
hexis/
├── db/*.sql                # Split schema files (tables, functions, views, triggers)
├── core/                   # Fundamental interfaces (DB + LLM + messaging)
│   ├── cognitive_memory_api.py   # Main memory client (remember, recall, hydrate)
│   ├── agent_api.py              # Agent status and configuration
│   ├── agent_loop.py             # Unified agent loop (heartbeat + chat)
│   ├── memory_tools.py           # Memory tool definitions + handlers
│   ├── tools/                    # Tool system (ToolHandler ABC, registry, ~80 handlers)
│   ├── consent.py                # Consent DB wrappers
│   ├── subconscious.py           # Subconscious DB wrappers
│   ├── state.py                  # Heartbeat/maintenance DB wrappers
│   ├── llm.py                    # LLM provider abstraction
│   ├── usage.py                  # Token and cost tracking
│   └── rabbitmq_bridge.py        # Messaging bridge
├── services/               # Orchestration/workflows built on core
│   ├── conversation.py     # Conversation loop orchestration
│   ├── ingest.py           # Ingestion pipeline orchestration
│   ├── worker_service.py   # Heartbeat + maintenance loops
│   └── prompts/            # Markdown prompt templates
├── characters/             # Preset character cards (JSON + images)
├── apps/
│   ├── hexis_cli.py          # CLI entrypoint (hexis ...)
│   ├── hexis_init.py         # Interactive init wizard
│   ├── hexis_api.py          # FastAPI API server (SSE chat)
│   ├── hexis_mcp_server.py   # MCP tools server for LLMs
│   └── worker.py             # Heartbeat + maintenance workers
├── channels/               # Multi-platform messaging adapters
├── hexis-ui/               # Next.js web dashboard
├── plugins/                # Plugin system (extensibility framework)
├── skills/                 # Skill system (declarative skill definitions)
├── ops/                    # Dockerfiles and deployment scripts
├── tests/
│   ├── db/                 # Database integration tests
│   ├── core/               # Core API tests
│   ├── services/           # Service-level tests
│   └── cli/                # CLI smoke tests
├── docs/                   # index.md + concepts/ guides/ reference/ operations/ …
│   ├── philosophy/PHILOSOPHY.md   # Philosophical framework
│   └── memory_retention_design.md # Compression-native memory substrate design
└── docker-compose.yml      # Local stack (Postgres + workers; local embedding sidecar)
```

### Key Files

| File | Purpose |
|------|---------|
| `db/*.sql` | Database schema split across tables, functions, triggers, and views. Applied on fresh DB init. |
| `core/cognitive_memory_api.py` | Primary Python interface - `CognitiveMemory` class with `remember()`, `recall()`, `hydrate()`, `connect()` |
| `services/worker_service.py` | Stateless workers: `HeartbeatWorker` (conscious loop) + `MaintenanceWorker` (subconscious upkeep) |
| `apps/hexis_mcp_server.py` | Exposes memory operations as MCP tools for LLM integration |
| `apps/hexis_cli.py` | CLI commands: `up`, `down`, `init`, `chat`, `ui`, `open`, `ingest`, `mcp` |
| `apps/hexis_api.py` | FastAPI server with SSE chat streaming |

## Memory Architecture

### Memory Types
- **Episodic**: Events with action, context, result, emotional valence
- **Semantic**: Facts with confidence, sources, contradictions
- **Procedural**: How-to steps with success tracking
- **Strategic**: Patterns with supporting evidence
- **Working**: Transient short-term buffer with expiry

### Key Database Tables
- `memories` - Base table (id, type, content, embedding, importance, trust_level)
- `clusters` - Thematic groupings with centroid embeddings
- `memory_neighborhoods` - Precomputed associative neighbors (hot-path optimization)
- `memories` (type=`worldview`, `goal`) - Beliefs, boundaries, and goals stored as memories
- `external_driver_calls` - Queue for LLM/embedding requests (LLM calls also route through `gateway_events`)
- `memory_graph` (Apache AGE) - Graph nodes/edges for multi-hop reasoning

### Key Database Functions
- `fast_recall(text, limit)` - Primary hot-path retrieval (vector + neighborhood + temporal)
- `create_semantic_memory()`, `create_episodic_memory()`, etc.
- `get_embedding(text[])` - Generate embeddings via HTTP (cached in DB), returns vector[]
- `run_heartbeat()` - Autonomous cognitive loop
- `run_subconscious_maintenance()` - Background upkeep

## Build, Test, and Development Commands

```bash
# Start services (db + RabbitMQ + heartbeat/maintenance workers; embeddings via local sidecar)
docker compose up -d

# Apply a schema change WITHOUT losing data (add db/migrations/NNNN_*.sql first)
hexis migrate            # or `hexis upgrade` to also refresh images/code

# Dev loop: watch mode — code + migration edits apply to the running stack
# automatically (sync + restart; Ctrl+C stops watching, stack keeps running).
# `hexis up` uses cached/published images by default, including in a source
# checkout. Use `hexis up --build` for a deliberate build or `hexis dev` while editing.
hexis dev

# Python runtime image dependencies are resolved only from the committed uv.lock.
# After changing pyproject.toml, refresh and verify it before building.
uv lock
uv lock --check

# Wipe the DB volume — deliberate clean slate only (loses all data)
docker compose down -v && docker compose up -d

# Configure agent (gates heartbeats until done)
hexis init

# Run tests (expects Docker services up)
pytest tests -q           # All tests
pytest tests/db -q        # DB integration tests
pytest tests/core -q      # Core API tests
pytest tests/cli -q       # CLI smoke tests

# CI parity checks (GitHub Actions)
# - Required branch check: all-checks-pass
# - CI uses ops/ci/fake_embeddings.py instead of the real embedding model
# - Migration-survivor proves existing DB data survives hexis migrate

# Other CLI commands
hexis status              # Agent status
hexis chat                # Interactive chat
hexis ingest --input <docs>  # Batch knowledge ingestion
hexis mcp                 # Start MCP server

Signals

Stars
621
Forks
86
Open issues
6
Last commit (this folder)
Aug 30, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from QuixiAI

Cite this page

CLAUDE.md · QuixiAI/Hexis. Agent Mart. https://agentmart.dev/templates/quixiai-hexis-claude-md (last updated 2026-10-24)