Skip to main content

Genuine AI epistemic self-assessment framework - Universal interface for single AI tracking

Project description

๐Ÿง  Empirica - Epistemic Vector-Based Functional Self-Awareness Framework

AI agents that know what they knowโ€”and what they don't

Version PyPI Python License Docker

What's New in 1.2.3

  • ๐Ÿšฆ Sentinel Safety Gates - Human-in-the-loop gates (PROCEED/HALT/BRANCH/REVISE) that bound AI autonomy
  • ๐Ÿค– Multi-Agent Spawning - Spawn epistemic sub-agents with agent-spawn, aggregate findings with agent-aggregate
  • ๐ŸŽญ Persona System - AI identity profiles that emerge from successful epistemic patterns (persona-list, persona-promote)
  • ๐Ÿ”ง 108 CLI Commands - Full coverage including assessment, trajectory projection, and drift detection
  • ๐ŸŒ™ 3-Layer Signaling - Moon phase indicators (๐ŸŒ‘โ†’๐ŸŒ•) for epistemic health at a glance
  • ๐Ÿ“ˆ Trajectory Projection - Project epistemic learning curves with trajectory-project
  • ๐Ÿข Turtle Principle - Recursive grounding: every claim must trace to verifiable source

โšก Claude Code Quick Start

What You Do vs What Claude Does

You Do (Once) Claude Does (Automatic)
pip install empirica Runs project-bootstrap to load prior learnings
Add snippet to ~/.claude/CLAUDE.md Logs findings as it works
Work normally Runs CHECK gates before risky actions
Saves what it learned at session end

Setup (2 minutes)

Step 1: Install

pip install empirica

Step 2: Add to ~/.claude/CLAUDE.md Copy this to ~/.claude/CLAUDE.md (Claude Code) or your AI's system prompt:

# Empirica - Epistemic Self-Assessment

You have Empirica installed. Use it to track what you know and learn.

## Quick Start
```bash
# Start session
empirica session-create --ai-id claude-code --output json

# Before work: What do I know?
empirica preflight-submit -

# After work: What did I learn?
empirica postflight-submit -

Core Vectors (0.0-1.0)

  • know: Domain knowledge (0.7+ = ready)
  • uncertainty: Doubt level (0.35- = ready)
  • context: Information access
  • do: Execution capability

Log As You Work

empirica finding-log --finding "Discovered X" --impact 0.7
empirica unknown-log --unknown "Need to investigate Y"

When Uncertain

Run CHECK gate: empirica check-submit -

Full docs: empirica --help


**Full setup guide:** [CLAUDE_CODE_SETUP.md](docs/guides/CLAUDE_CODE_SETUP.md) (hooks, MCP, troubleshooting)
**Full system prompt:** [CLAUDE.md](docs/system-prompts/CLAUDE.md) | [CANONICAL_CORE.md](docs/system-prompts/CANONICAL_CORE.md)

### Step 3: (Optional) MCP for Claude Desktop
Add to `claude_desktop_config.json`:
```json
{
  "mcpServers": {
    "empirica": {
      "command": "empirica-mcp",
      "env": { "EMPIRICA_AI_ID": "claude-desktop" }
    }
  }
}

Docker

docker pull nubaeon/empirica:1.2.3

How It Works Day-to-Day

You don't need to type Empirica commands. Just talk to Claude normally:

You Say (Natural Language) Claude Does (Behind the Scenes)
"Continue working on the auth refactor" Runs project-bootstrap โ†’ loads what it learned last session
"I'm not sure about this approach" Runs check-submit โ†’ assesses if it knows enough to proceed
"Good work, let's wrap up" Runs postflight-submit โ†’ saves learnings for next time

What is project-bootstrap?

When Claude starts a session, project-bootstrap loads ~800 tokens of structured context:

๐Ÿ“Š Epistemic State: know=0.85, uncertainty=0.15
๐ŸŽฏ Active Goals: Refactor auth module (in_progress)
๐Ÿ’ก Recent Findings: "Auth uses JWT with 15min expiry"
โ“ Open Unknowns: "Token rotation mechanism unclear"

This replaces 200k tokens of conversation history with just the important bits.

Will Claude ignore the commands?

Sometimes, especially mid-task. But after a memory compact (when context summarizes), Claude naturally looks for contextโ€”that's when bootstrap shines. The CLAUDE.md instructions make this reliable.

Live Metacognitive Signal

With Claude Code hooks enabled, you see Claude's epistemic state in real-time:

[empirica] โšก79% โ”‚ โšก PRAXIC โ”‚ POSTFLIGHT โ”‚ K:80% U:20% C:90% โ”‚ ฮ” K:+0.30 U:-0.30 C:+0.30 โ”‚ โœ“ stable

What this tells you:

  • โšก79% - Overall epistemic confidence
  • PRAXIC - Claude is in action mode (vs NOETIC = investigation mode)
  • POSTFLIGHT - Just completed a task and logged learnings
  • K:80% U:20% - 80% knowledge, 20% uncertainty (healthy state)
  • ฮ” K:+0.30 - Gained 30% knowledge this session (learning delta)
  • โœ“ stable - No epistemic drift detected

Why this matters: You can see when Claude is uncertain before it acts, when it's learning, and when it might be drifting from reality. No more guessing if Claude actually knows what it's doing.

What is Empirica?

Empirica is an epistemic self-awareness framework for AI agents that enables genuine self-assessment, systematic learning tracking, and effective multi-agent collaboration.

Unlike traditional AI tools that rely on static prompts or heuristic-based evaluation, Empirica provides 13-dimensional epistemic vector tracking that allows AI agents to know what they know (and don't know) with measurable precision.

Core Philosophy: Epistemic Self-Awareness

The Problem: AI agents often exhibit "confident ignorance" - they confidently generate responses about topics they don't actually understand.

The Solution: Empirica enables genuine epistemic self-assessment through:

  1. 13-Dimensional Vector Space - Track knowledge, capability, context, and uncertainty across multiple dimensions
  2. CASCADE Workflow - Structured reasoning process with explicit epistemic gates
  3. Dynamic Context Loading - Resume work with compressed project memory
  4. Multi-Agent Coordination - Seamless handoffs between AI agents

Key Features

  • โœ… Honest uncertainty tracking: "I don't know" becomes a measured response
  • โœ… Focused investigation: Direct effort where knowledge gaps exist
  • โœ… Genuine learning measurement: Track what you learned, not just what you did
  • โœ… Session continuity: Resume work across sessions without losing context
  • โœ… Multi-agent coordination: Share epistemic state across AI teams

Result: AI you can trustโ€”not because it's always right, but because it knows when it might be wrong.

๐Ÿš€ Quick Start

Installation

PyPI (Recommended)

# Core installation
pip install empirica

# With API/dashboard features
pip install empirica[api]

# With vector search
pip install empirica[vector]

# Everything
pip install empirica[all]

Docker

# Pull the latest image
docker pull nubaeon/empirica:1.2.3

# Run a command
docker run -it nubaeon/empirica:1.2.3 empirica --help

# Interactive session with persistent data
docker run -it -v $(pwd)/.empirica:/data/.empirica nubaeon/empirica:1.2.3 /bin/bash

From Source

# Latest stable release
pip install git+https://github.com/Nubaeon/empirica.git@v1.2.3

# Development branch
pip install git+https://github.com/Nubaeon/empirica.git@develop

Initialize a New Project

# Navigate to your git repository
cd your-project
git init

# Initialize Empirica
empirica project-init

Your First Session

# AI-first JSON mode (recommended for AI agents)
echo '{"ai_id": "myagent", "session_type": "development"}' | empirica session-create -

๐ŸŽฏ Core Workflow: CASCADE

Empirica uses CASCADE - a metacognitive workflow with explicit epistemic phases:

# 1. PREFLIGHT: Assess what you know BEFORE starting
cat > preflight.json <<EOF
{
  "session_id": "abc-123",
  "vectors": {
    "engagement": 0.8,
    "foundation": {"know": 0.6, "do": 0.7, "context": 0.5},
    "comprehension": {"clarity": 0.7, "coherence": 0.8, "signal": 0.6, "density": 0.7},
    "execution": {"state": 0.5, "change": 0.4, "completion": 0.3, "impact": 0.5},
    "uncertainty": 0.4
  },
  "reasoning": "Starting with moderate knowledge of OAuth2..."
}
EOF
cat preflight.json | empirica preflight-submit -

# 2. WORK: Do your actual implementation
#    Use CHECK gates as needed for decision points

# 3. POSTFLIGHT: Measure what you ACTUALLY learned
cat > postflight.json <<EOF
{
  "session_id": "abc-123",
  "vectors": {
    "engagement": 0.9,
    "foundation": {"know": 0.85, "do": 0.9, "context": 0.8},
    "comprehension": {"clarity": 0.9, "coherence": 0.9, "signal": 0.85, "density": 0.8},
    "execution": {"state": 0.9, "change": 0.85, "completion": 1.0, "impact": 0.8},
    "uncertainty": 0.15
  },
  "reasoning": "Successfully implemented OAuth2, learned token refresh patterns"
}
EOF
cat postflight.json | empirica postflight-submit -

Result: Quantified learning (know: +0.25, uncertainty: -0.25)

โœจ Key Features

๐Ÿ“Š Epistemic Self-Assessment (13 Vectors)

Track knowledge across 3 tiers:

  • Tier 0 (Foundation): engagement, know, do, context
  • Tier 1 (Comprehension): clarity, coherence, signal, density
  • Tier 2 (Execution): state, change, completion, impact
  • Meta: uncertainty (explicit tracking)

๐ŸŽฏ Goal-Driven Task Management

# Create goals with epistemic scope
echo '{
  "session_id": "abc-123",
  "objective": "Implement OAuth2 authentication",
  "scope": {
    "breadth": 0.6,
    "duration": 0.4,
    "coordination": 0.3
  },
  "success_criteria": ["Auth works", "Tests pass"],
  "estimated_complexity": 0.65
}' | empirica goals-create -

๐Ÿ”„ Session Continuity

# Load project context dynamically (~800 tokens)
empirica project-bootstrap --project-id <PROJECT_ID>

๐Ÿค Multi-Agent Coordination

Spawn epistemic sub-agents:

# Spawn a sub-agent for parallel investigation
empirica agent-spawn --session-id <ID> --task "Investigate auth patterns" --depth medium

# Sub-agent reports back
empirica agent-report --session-id <SUB_ID> --findings '[...]' --confidence 0.8

# Aggregate findings from multiple agents
empirica agent-aggregate --parent-session-id <ID> --merge-strategy weighted

Share epistemic state via git notes:

# Push your epistemic checkpoints
git push origin refs/notes/empirica/*

# Pull team member's state
git fetch origin refs/notes/empirica/*:refs/notes/empirica/*

๐Ÿšฆ Sentinel Safety Gates

Bounded AI autonomy with human oversight:

# Check if operation is safe to proceed
empirica sentinel-check --operation '{"type": "code_generation", "scope": "high"}' --session-id <ID>

# Returns: PROCEED | HALT | BRANCH | REVISE

# Orchestrate multi-step workflow with gates
empirica sentinel-orchestrate --workflow workflow.json --session-id <ID>

Gate types:

  • PROCEED - Safe to continue autonomously
  • HALT - Requires human approval before continuing
  • BRANCH - Spawn investigation before proceeding
  • REVISE - Modify approach and resubmit

๐ŸŽญ Persona System

AI identity profiles that emerge from successful patterns:

# List available personas
empirica persona-list

# Find persona matching current task
empirica persona-find --task "security audit" --session-id <ID>

# Promote traits based on successful outcomes
empirica persona-promote --persona-id researcher --trait thoroughness --evidence "Found 3 critical bugs"

๐Ÿ“ˆ Drift Detection & Trajectory

Monitor epistemic health and project learning curves:

# Check for behavioral drift
empirica check-drift --session-id <ID>

# Project epistemic trajectory
empirica trajectory-project --session-id <ID> --horizon 5

# Assess current epistemic state
empirica assess-state --session-id <ID> --include-history

Moon phase indicators for health at a glance:

  • ๐ŸŒ‘ Critical (coverage < 25%)
  • ๐ŸŒ’ Low (25-50%)
  • ๐ŸŒ“ Moderate (50-75%)
  • ๐ŸŒ” Good (75-90%)
  • ๐ŸŒ• Excellent (90%+)

๐Ÿ“ฆ Optional Integrations

BEADS Issue Tracking

Install BEADS (separate Rust project):

cargo install beads

MCP Server (Model Context Protocol)

For AI tools that support MCP:

# Install MCP server
pip install empirica-mcp

# Run server
empirica-mcp

Features: 57 tools including 9 Human Copilot tools for enhanced human oversight.

Claude Code Integration

Automatic epistemic continuity across memory compacts:

# Install plugin (bundled with Empirica)
./scripts/install_claude_plugin.sh

Vector Search (Qdrant)

pip install empirica[vector]

# Start Qdrant
docker run -p 6333:6333 qdrant/qdrant

# Embed docs
empirica project-embed --project-id <PROJECT_ID>

# Search
empirica project-search --project-id <PROJECT_ID> --task "oauth2"

๐Ÿ“š Documentation

Getting Started

Guides

Reference

๐Ÿ”’ Privacy & Data Isolation

Your data is isolated per-repo:

  • โœ… .empirica/ - Local SQLite database (gitignored)
  • โœ… .git/refs/notes/empirica/* - Epistemic checkpoints (local by default)
  • โœ… .beads/ - BEADS database (gitignored)

๐Ÿ› ๏ธ Development

Running Tests

# Core tests
pytest tests/

# Integration tests
pytest tests/integration/

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

๐Ÿ“Š System Requirements

  • Python: 3.11+
  • Git: Required for epistemic checkpoints
  • Optional: Docker (for Qdrant), Rust/Cargo (for BEADS)

๐ŸŽ“ Learn More

Research & Concepts

Use Cases

  • Research & Development
  • Multi-Agent Teams
  • Long-Running Projects
  • Training Data Generation
  • Epistemic Audit Trails

๐Ÿ”— Related Projects

๐Ÿ“ž Support

๐Ÿ“œ License

MIT License - Maximum adoption, trust-aligned with Empirica's transparency principles.

See LICENSE for details.


Built with genuine epistemic transparency ๐Ÿง โœจ

Project details


Release history Release notifications | RSS feed

This version

1.2.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

empirica-1.2.4.tar.gz (787.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

empirica-1.2.4-py3-none-any.whl (848.4 kB view details)

Uploaded Python 3

File details

Details for the file empirica-1.2.4.tar.gz.

File metadata

  • Download URL: empirica-1.2.4.tar.gz
  • Upload date:
  • Size: 787.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for empirica-1.2.4.tar.gz
Algorithm Hash digest
SHA256 2f451110b23307bbd2b8a7f5918ae6fd78ee09153a2dfecac94270b382a7b135
MD5 6ca7c15575e9810e91f1a8b0eb8aead0
BLAKE2b-256 6d09e26c7e9eb400b9a2443eeb9e8e16be406ce65eabb03d517cde49e23a34b4

See more details on using hashes here.

File details

Details for the file empirica-1.2.4-py3-none-any.whl.

File metadata

  • Download URL: empirica-1.2.4-py3-none-any.whl
  • Upload date:
  • Size: 848.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for empirica-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2223cb9c1b422c0a48c078d68e136cc52ea14c9f3332b9c518db518800dd9553
MD5 013cebf6f204ab2548e8b5263c69b6a4
BLAKE2b-256 02da20da2093d0325a8d94d61e0e8bb6329f10e221bcd7ee1d341beaca462b67

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page