Prometheus

Open-source, model-agnostic agent framework for local hardware. Wraps any LLM in a validation layer that catches malformed tool calls, retries with structured feedback, and enforces output schemas. The model is the agent. The harness is the vehicle.

GitHub Architecture

MIT License · Python 3.11+ · 16K+ Lines · 125+ Tests

Core Systems
Agent Loop

Clean-room reimplementation derived from Claude Code's architecture. Pydantic-validated tool calls, PreToolUse/PostToolUse hook pipeline, permission governance. Works with any model.

Lossless Context Management

DAG-based conversation compression. Every message persisted to SQLite. Old messages summarized into expandable nodes. FTS5 full-text search. Works within 32K context windows.

SENTINEL

Proactive background intelligence. Watches telemetry, sends nudges via Telegram during idle. AutoDream engine: wiki lint, memory consolidation, telemetry digest, knowledge synthesis. Budget-capped. Never exceeds autonomous trust level.

Wiki Knowledge System

Compounding knowledge base (Karpathy's LLM Wiki concept). Memory Extractor runs every 30 min. WikiCompiler builds entity pages with cross-references. Query results file back as new pages. Obsidian-compatible.

Security Gate

4-level trust: BLOCKED, APPROVE, AUTO, AUTONOMOUS. 33+ blocked patterns. Workspace boundary enforcement. Bash intent analysis. Memory security scanning.

Model Adapter Layer

Validator catches malformed tool calls. Formatter translates between model formats. Enforcer constrains output to valid schemas (configurable strictness per model). Retry engine with structured error feedback.

Architecture
Your Machine (or split across two)
│
├── Prometheus daemon (systemd)
│   ├── Agent Loop
│   ├── Telegram / Slack Gateway
│   ├── Heartbeat + Cron
│   ├── Memory Extractor
│   ├── Wiki Compiler
│   ├── SENTINEL
│   ├── LCM Engine
│   └── Doctor (infra diagnostics)
│
├── Model Provider (local or remote)
│   ├── llama.cpp         any GGUF model
│   ├── Ollama            one-line model pulls
│   ├── Anthropic API     Claude via API key
│   └── OpenAI-compat     any provider with /v1/chat
│
├── SQLite databases
│   ├── memory.db
│   ├── telemetry.db
│   └── lcm.db
│
└── ~/.prometheus/
    ├── wiki/             knowledge base
    ├── sentinel/         dream logs
    ├── skills/auto/      learned skills
    └── workspace/        sandboxed execution

Runs single-machine or split brain/GPU across two boxes. All data in SQLite on your filesystem. Nothing phones home.

Install

Prerequisites: Python 3.11+, a running llama.cpp or Ollama instance (or a cloud API key), optional Telegram bot token for the messaging gateway.

1. Clone & Install
git clone https://github.com/whieber1/Prometheus-.git
cd Prometheus-
pip install -e .
2. Configure
cp config/prometheus.yaml.example config/prometheus.yaml
# Set your inference endpoint and optional Telegram token
3. Run
python scripts/daemon.py
bash file_read file_write file_edit grep glob cron_create cron_delete cron_list task_create task_get task_list task_update task_stop task_output todo_write skill agent lcm_grep lcm_expand lcm_describe lcm_expand_query wiki_compile wiki_query wiki_lint sentinel_status

Read-only tools run in parallel via asyncio.gather. Mutating tools run sequentially. Security hooks fire on every call.

Interface
CommandDescription
/startWelcome message
/statusModel, uptime, tools, memory, SENTINEL state
/helpList commands and capabilities
/resetClear conversation context
/modelCurrent model name and provider
/wikiWiki stats, page count, recent updates
/sentinelSENTINEL status, last dream results
/doctorRun 15 diagnostic checks across config, models, storage, network

Telegram gateway ships first. Slack adapter in development. CLI REPL available.

Provenance

Not a fork. Five MIT-licensed donors, three novel systems built from scratch.

SourceContribution
OpenHarness (HKUDS)Agent loop, tool registry, hook pipeline, permissions
Hermes Agent (NousResearch)Messaging gateway, cron, credential rotation
Lossless-ClawLCM engine (11,600 lines TS → Python)
Claude Code patternsSystem prompt architecture (clean-room reimplementation)
OpenClawMemory extractor, archive bridge patterns

Novel systems: Model Adapter Layer, SENTINEL, Wiki Knowledge System. Every extracted file includes a header with source, license, and modifications.

Project Structure
prometheus/
├── src/prometheus/
│   ├── engine/          # Agent loop, turn execution
│   ├── adapter/         # Model Adapter Layer
│   ├── providers/       # llama_cpp, ollama, anthropic, stub
│   ├── tools/builtin/   # 25 builtin tools
│   ├── hooks/           # PreToolUse / PostToolUse pipeline
│   ├── permissions/     # 4-level security gate
│   ├── memory/          # LCM, wiki, extractor, store
│   ├── context/         # Token budget, compression, prompt assembly
│   ├── skills/          # Skill loader + registry
│   ├── tasks/           # Background task manager
│   ├── gateway/         # Telegram, cron, heartbeat
│   ├── sentinel/        # Observer, AutoDream
│   ├── learning/        # Nudge, skill creator/refiner
│   ├── coordinator/     # Subagent spawning
│   ├── telemetry/       # Tool call tracking (SQLite)
│   ├── config/          # Settings management
│   └── infra/           # Doctor diagnostics, model registry
├── tests/               # 125+ tests
├── config/prometheus.yaml
├── benchmarks/          # Tier 1 + Tier 2 suite
└── PROMETHEUS.md        # Agent instructions