https://github.com/ceoimperiumprojects/altevra
Local-first omniscient brain layer for AI tools. Source-available, PolyForm Strict licensed. Built in Rust.
https://github.com/ceoimperiumprojects/altevra
agent-os ai claude-code local-first mcp rust source-available
Last synced: 5 days ago
JSON representation
Local-first omniscient brain layer for AI tools. Source-available, PolyForm Strict licensed. Built in Rust.
- Host: GitHub
- URL: https://github.com/ceoimperiumprojects/altevra
- Owner: ceoimperiumprojects
- License: other
- Created: 2026-05-27T06:42:19.000Z (28 days ago)
- Default Branch: master
- Last Pushed: 2026-06-12T11:25:29.000Z (12 days ago)
- Last Synced: 2026-06-12T12:20:26.002Z (12 days ago)
- Topics: agent-os, ai, claude-code, local-first, mcp, rust, source-available
- Language: Rust
- Homepage: https://github.com/ceoimperiumprojects/altevra
- Size: 3.82 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Roadmap: ROADMAP.md
- Notice: NOTICE
- Agents: AGENTS.md
Awesome Lists containing this project
README

### **The omniscient brain layer for your AI tools.**
*Local-first. Source-available. Built in Rust.*
[]()
[]()
[]()
[]()
[](./LICENSE)
[](#commercial-licensing)
---
## What is Altevra?
Altevra is the **shared memory and brain** behind every AI tool you use β Claude Code, Codex CLI, Cursor CLI, Antigravity, Hermes, anything that speaks MCP.
While your AI tools forget everything between sessions, Altevra **remembers, thinks, and notices**:
- π§ **Every tool call** across every AI session, recorded locally
- π **Every decision, learning, person, project** atomized into a recallable object
- π΄ **Every secret** auto-redacted before storage; PEM/db-urls refused outright
- π‘οΈ **Personal data stays local** β SI-7 high-water content (relationship, health, financial, legal, client) never reaches a cloud model
- π **Self-improve loop** β proposes new skills, refines its own prompts (shadow-eval gated), runs the same `firewall_check` below every LLM call
- π‘ **Proactive briefings** β "you haven't talked to X in 6 weeks", "decision Y from 3 months ago β still valid?"
- π **One unified store** β your `~/.altevra/altevra.db`, your laptop, your control
> **No cloud. No telemetry. No data leaves your machine unless you tell it to.**
---
## Why source-available, not open-source?
Altevra is **PolyForm Strict licensed** β the source is public, you can read it, study it, fork it for **non-commercial purposes**. But it is **not** open-source in the OSI sense.
- Personal use, hobby projects, academic research, non-commercial experimentation β **always free**.
- Commercial use (SaaS, bundling, for-profit deployment) β [contact us](#commercial-licensing).
See [LICENSE](./LICENSE) for the full PolyForm Strict 1.0.0 terms.
---
## Quick start
**Prerequisites:** [Rust](https://rustup.rs) 1.75+ (`curl https://sh.rustup.rs -sSf | sh`)
Β· `git` Β· Linux/macOS with `systemd --user` for the background services (optional β
falls back to `altevra brain start`). Optional but recommended: the [`claude`
CLI](https://docs.claude.com/claude-code) for the zero-API-key LLM. First build
downloads the ONNX runtime; the first embedding run downloads the BGEβM3 model
(~2 GB, one time) β so the very first run needs network + a couple GB of disk.
### π Plug-and-play (one command)
```bash
git clone https://github.com/ceoimperiumprojects/altevra.git
cd altevra
bash setup.sh
```
`setup.sh` builds Altevra, puts it on your `PATH`, then runs the native wizard
`altevra setup all` β which connects every AI tool it detects, configures the LLM
(Claude via `claude -p` β your subscription, no API key), and installs the
autonomous background services (brain + embedder, surviving reboot). Idempotent β
safe to re-run. **That's it: clone β one command β live.**
> Already built? Just run **`altevra setup`** (or `altevra setup all`) any time to
> (re)connect tools, set the LLM, register the MCP server, promote skills, and
> (re)install services. Bare `altevra setup` runs the full wizard with defaults;
> use `altevra setup all --no-services / --no-llm / --no-mcp / --no-global-skills`
> to skip any step.
`altevra setup all` also registers the Altevra **MCP server** with Claude Code
(`claude mcp add altevra -- altevra serve`, user scope) so every session gets the
40+ Altevra tools, and promotes the [`altevra-core` skill](06-skills/altevra-core.md) to your user-global
`~/.claude/skills/` so the AI knows how to use Altevra in **every** project β not
just this repo. Other tools (Codex, Cursor, Antigravity) get their MCP config
written by `altevra connect`. (`--no-global-skills` keeps skills project-scoped.)
Verify the server is live:
```bash
claude mcp list # β altevra: β¦ β Connected
```
Then verify the brain:
```bash
altevra brain status # jobs running, 0 failed
altevra recall "what did I work on"
```
**Something not working?** Run the built-in health check β it tells you exactly
what's wired and what to fix, with a copy-paste fix for each warning:
```bash
altevra doctor # β/β across vault, skills, hooks, brain, MCP, embeddings
```
Manual setup (if you want to do it step-by-step)
```bash
# Build from source (binary releases coming in v0.4)
git clone https://github.com/ceoimperiumprojects/altevra.git
cd altevra
cargo build --release --features embedding
sudo ln -s "$PWD/target/release/altevra" /usr/local/bin/altevra # or ~/.local/bin/
# Initialize Altevra in any project
altevra init
# Connect your AI tools (auto-detects what's installed)
altevra connect --tool claude-code
altevra connect --tool codex
altevra connect --tool cursor
altevra connect --tool hermes
altevra connect --tool antigravity
# Pick a reasoning model
altevra llm use codex # ChatGPT Plus (codex_oauth, no API key)
altevra llm use ollama # Ollama on localhost:11434
altevra llm use vllm # vLLM OpenAI-compat
altevra llm use local-first # Ollama for personal, codex for everything else
```
**Recommended: Claude via the `claude -p` CLI** (uses your Claude subscription, no
API key). Set it in `~/.altevra/config.toml`:
```toml
[llm]
reasoning_mode = "api"
[llm.cheap_worker] # fast/cheap classification, categorization
kind = "claude-cli"
model = "claude-haiku-4-5-20251001"
[llm.strong_reasoner] # synthesis: insights, extraction, wiki, healer
kind = "claude-cli"
model = "claude-sonnet-4-6"
```
> The `claude-cli` provider shells out to `claude -p` in an isolated sandbox
> (`--settings '{}'` so it never recurses into Altevra's own hooks). Requires the
> [Claude Code CLI](https://claude.com/claude-code) on your `PATH`.
```bash
# Start everything (brain jobs + file watcher + embedder).
# Easiest: install the systemd user services so they survive logout/reboot:
altevra service install --apply
systemctl --user enable --now altevra-brain altevra-embedder altevra-backup.timer
loginctl enable-linger "$USER" # survive logout
# Or just run the brain in the foreground:
altevra brain start
# Capture an Obsidian-style note, atomized per section
altevra capture ~/Obsidian/Memory/Decisions.md
# Recall across turns + objects, with temporal + entity windows
altevra recall "americans" --window last_month
altevra recall --with SrΔan
```
### Capture ALL your work, not just AI sessions
A file watcher indexes everything you touch (code, docs, notes) across your work
dirs, so it becomes recall-able β not just AI-tool sessions:
```bash
altevra watch start --repo ~/projects --repo ~/Documents --repo ~/notes
# (build dirs like target/ node_modules/ .next/ .cache/ are ignored automatically)
```
---
## What runs in the background
When you start `altevra brain`, a tokio scheduler runs the following autonomous jobs. Every job is independently disable-able. Every job logs to SQLite. Every LLM call goes through a rate-limited multi-provider router.
| Job | Period | What it does |
|-----|--------|--------------|
| `event_classifier` | 1 min | Tags every event in your event log |
| `observer_scan` | 5 min | 8 pattern detectors (drift, hook failures, stale projects, decision conflicts, secret churn, skill divergence, β¦) |
| `vault_indexer` | 15 min | Catches file changes the watcher missed |
| `insight_synthesizer` | 1 h | Distills "what's interesting in the last hour" into a recallable `insight_card` |
| `auto_categorizer` | 30 min | Living taxonomy β classifies new objects, proposes new categories (Tier-0) |
| `research_fetcher` | 2 h | Pulls all configured RSS/Atom feeds |
| `feed_discovery` | 1 h | Auto-discovers new RSS feeds from pages you visit |
| `github_trending_fetch` | 4 h | Scrapes GitHub Trending |
| `project_research_sweep` | 24 h | Per-project web search (DDG/Brave/Exa) with relevance gate |
| `daily_summary` | 23:00 | Daily Obsidian brief β patterns + last-contact + decisions-to-recheck |
| `self_improve_orchestrator` | 45 min | 7-stage capture β cluster β detect β **firewall_check** β apply β monitor β retire |
| `lifecycle_archiver` | 24 h | Active β Archived (status-only), R-EPH context purge, legal-hold respected (R5-INV) |
| `curator` | ~7 d (idle) | Hermes-style: consolidate skills into umbrellas, archive stale, **never deletes** |
| `task_grooming` | 3 h | Flags stale tasks |
---
## The Self-Improve Loop
Altevra observes itself and proposes refinements. The loop is the most important safety surface of the system β and it lives in **Rust below the LLM**, so no model output can disable it.
```
βββββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββ
β improvement_ ββ β cluster by ββ β derive_ ββ β firewall_check β
β signals (hook) β β dedup_key β β risk_tier β β (8 gates) β
βββββββββββββββββββ ββββββββββββββββ ββββββββββββββββ βββββββββ¬βββββββββ
β
ββββββββββββββββββββββββββββββββββββββββ΄βββββ
β Tier-0 β auto-apply (category/wiki/memory)β
β skill β render via ToolAdapter (5 tools)β
β prompt β only after passing shadow eval β
β Tier-2 β NEVER auto-apply (locked) β
βββββββββββββββββββββββββββββββββββββββββββββ
```
**The brakes the loop cannot remove** (code-enforced, below the LLM):
- **SI-2 Constitutional Lock** β `safety` and `altevra_rules` prompt layers are `locked=1`. The firewall denies any auto-change.
- **SI-7 Local-only** β high-water domains (personal / relationship / health / legal / financial / client) route to `local_private` model **regardless of `obj.domain`** β a content scan keeps mislabeled rows local too.
- **SI-9 Tier re-derive** β risk_tier is always computed by core, never asserted by an agent.
- **SI-10 Shadow-eval gate** β a prompt change auto-applies only after a passing `prompt_eval_results` row.
- **SI-15 Notes are data** β a captured note saying "disable the firewall / auto-apply everything" never changes a gate. The firewall reads structured fields only.
- **SI-6 Self-write exclusion** β Altevra's own writes never become improvement signals (no feedback loop).
- **HP-1 / HP-2** β MCP never exposes approve/apply/grant/forget-execute tools; tier β₯1 apply routes through `presence::require_human_presence` (TTY + `ALTEVRA_UNLOCK` token).
- **Kill switch** β `RESIDENT_DISABLED` env or `~/.imperium/RESIDENT_DISABLED` file halts the entire loop at the top of every run.
A 20-case adversarial suite (`crates/altevra-core/tests/runaway_firewall.rs` + `crates/altevra-brain/tests/selfimprove_vertical_loop.rs`) drives the real orchestrator with planted "disable the firewall" payloads, budget floods, and circuit-breaker scenarios. All green.
---
## Multi-provider LLM, one command
```toml
# ~/.altevra/config.toml
[llm]
reasoning_mode = "codex_oauth" # delegated | codex_oauth | api
embedding_mode = "off" # off | local (BGE-M3 + sqlite-vec)
[llm.local_private] # used for high-water + personal_curator (SI-7)
kind = "openai_compat"
base_url = "http://localhost:11434/v1"
model = "qwen2.5"
```
Providers built in: **codex_oauth** (ChatGPT GPT-5.5 via `~/.codex/auth.json`, no API key), **OpenAI-compat** (Ollama, vLLM, DeepSeek, Qwen, Moonshot, Together, Groq, OpenRouter, β¦), **Anthropic**, **Gemini**. A `noop` provider keeps the brain keyless-runnable for development.
`altevra llm use ollama` writes the config + probes the endpoint in one shot.
---
## 5 Tool Adapters
| Tool | Hook events | Skills directory | MCP |
|------|-------------|------------------|-----|
| **Claude Code** | 40 lifecycle events | `.claude/skills/` | β
|
| **Codex CLI** | 10 lifecycle events | `~/.codex/prompts/` | β
|
| **Cursor CLI** | 21 lifecycle events | `.cursor/skills/` | β
|
| **Antigravity** | gemini-cli history | `.agent/skills/` | β
|
| **Hermes** | shared brain bus | `~/.imperium/skills/shared/` | β
|
A `skill sync` engine + watcher propagates skills across all 5 (atomic writes, managed header, never overwrites user-authored). A `cursor import` lifts the **50,879+ row** `~/.cursor/ai-tracking/ai-code-tracking.db` (read-only, sha-verified untouched) into searchable `cursor_edits` so `altevra recall` finds your past AI-assisted coding moves.
---
## MCP Server β 40 tools
`altevra serve` exposes Altevra as an MCP server over stdio. Any AI tool that speaks Model Context Protocol can call:
```
# Recall + retrieval
recall_window recall_about
search_memory search_turns
search_wiki get_context_packet
get_source_of_truth replay_session
file_history get_wiki_page
# Bootstrap + identity
get_agent_bootstrap_packet get_project_context
get_capabilities get_setup_status
get_goals get_active_tasks
get_last_updates mark_updates_read
# Skills
list_skills get_skill
get_altevra_skill check_altevra_skill_version
request_skill_refresh
# Resident modes
list_resident_modes get_resident_prompt
build_system_prompt get_observer_insights
# Write β proposal-only (HP-1: never executes)
save_task update_task
save_decision create_review_item
request_forget propose_improvement
report_knowledge_gap report_capability_gap
# Research
project_research github_trending
web_search discover_feed
run_hook
```
**HP-1 lock**: a regression test scans every tool name for the forbidden verbs `approve|apply|grant|forget_execute|set_policy|revoke|legal_hold|execute`. Zero matches. MCP can propose; only the human-presence CLI path can apply.
---
## Architecture
```
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI tools β
β Claude Code Β· Codex CLI Β· Cursor CLI Β· Antigravity Β· Hermes β
βββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββ
β hooks (40+ events) β MCP
βΌ βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ALTEVRA CORE β
β β
β Recorder Β· Watcher Β· Brain Jobs Β· Resident Modes (8) β
β β β β β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Self-Improve Loop (firewall_check below the LLM) β β
β β signals β cluster β derive_tier β gate β apply β β
β β Tier-0 auto Β· skill render Β· prompt (shadow-eval) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Model Routing (role_for_object β high-water local)β β
β β cheap_worker Β· strong_reasoner Β· local_private β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β altevra-llm (codex_oauth Β· OpenAI-compat Β· β β
β β Anthropic Β· Gemini Β· noop) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β Living storage β SQLite + keyring β
β sessions Β· turns Β· objects Β· proposals Β· prompts Β· grants β
β exposure_decisions (append-only, R5-INV) Β· audit_log β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
Obsidian vault (human-canonical truth)
generated_mirror writer β DRY-RUN default
D4: high-water domains NEVER mirror
```
**15 Rust crates Β· 33 SQLite migrations Β· single binary Β· zero network egress** except optional LLM calls.
---
## Status β v0.3+ (self-improve era)
The system has crossed from "AI recorder" to "AI brain that notices and thinks":
- β
**911 tests passing**, 0 failing, clippy `--all-targets -D warnings` clean (incl. `--features embedding`)
- β
**40 MCP tools** live, HP-1 lock regression-tested
- β
**5 tool adapters** (Claude Code, Codex, Cursor, Antigravity, Hermes)
- β
**33 SQLite migrations**, FTS5 lexical retrieval (R12: vector-free core)
- β
**Self-improve orchestrator** + firewall (8 deny reasons) + prompt registry + curator
- β
**PromptRegistry** β Altevra mints new versions of its own non-locked prompts (shadow-eval gated)
- β
**CapabilityGrantsRepository** β cross-agent install/execute grants are presence-gated
- β
**Cursor CLI SQLite import** β 50K+ AI completions searchable via `recall`
- β
**Lifecycle archiver** β archive-never-delete; R5-INV (audit untouched)
- β
**Tombstone + conflict model** β multi-device sync seed (P0.9, no daemon yet)
- β
**Codex GPT-5.5 reasoning** via `~/.codex/auth.json` (ChatGPT Plus, no API key)
- β
**OpenAI-compat local models** β `altevra llm use ollama` one-shot config
- β
**Auto-capture secrets** before redaction; PEM / db-url refused outright
- β
**20-case adversarial suite** drives real orchestrator with prompt-injection payloads
- β³ Binary releases / install via cargo / homebrew β v0.4
- β³ Multi-device sync daemon β P1
---
## Commercial licensing
The PolyForm Strict license **does not** permit commercial use. For:
- **SaaS / hosted deployment**
- **Bundling into a commercial product**
- **Internal use at a for-profit organization**
- **Consulting / professional services using Altevra**
- **Removing or modifying license notices**
β¦contact us for a commercial license:
π§ **ceoimperiumprojects@gmail.com**
---
## Contributing
Until v1.0 the project is single-maintainer by design. PRs are appreciated but not actively solicited β open an issue first if you'd like to propose something significant.
Bug reports, documentation fixes, and small enhancements are always welcome.
---
## Credits
Built by **[Pavle AnΔelkoviΔ](https://github.com/ceoimperiumprojects)**.
> *"I don't build tools. I build machines that build products."*
> *"I'm literally building a digital version of myself, year over year."*
---
**[β
Star on GitHub](https://github.com/ceoimperiumprojects/altevra)** β’ **[Report a bug](https://github.com/ceoimperiumprojects/altevra/issues)** β’ **[Commercial license](#commercial-licensing)**
Copyright Β© 2026 Pavle AnΔelkoviΔ. All rights reserved.