Skip to content

rfi-irfos/agent-albert-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Albert CLI

The sovereign AI development CLI for the Ternary Intelligence Stack

Rust License: MIT Crates.io Part of TIS Studio

Albert is a terminal-native, model-agnostic AI agent built in pure Rust. It runs a hardened agentic loop — research → strategy → execute — with every action validated through ternary logic before anything touches your system.


image

Quick Start

# One line — installs Rust (if needed) + albert-cli, ready immediately
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && source "$HOME/.cargo/env" && cargo install albert-cli

# Launch the agent
albert-cli

Note: Do not use sudo apt install cargo — Ubuntu's packaged version is too old (1.75). The line above installs the current toolchain via rustup.

That's it. Albert spins up the REPL and the onboarding will start.

How it thinks

Albert operates in exactly three states:

Signal Meaning What happens
+1 Affirm Safe to proceed — action is executed
0 Tend Context missing — Albert pauses and asks before continuing
-1 Reject Failure detected — Albert self-corrects and retries

This is enforced at the engine level. Albert will not hallucinate an answer, silently skip a step, or execute an ambiguous command.


Features

Sovereign Security

  • Deny-first AST interception — every shell command is parsed by a native Rust pipeline before it reaches the OS. Command substitution, dangerous pipes (curl | bash), and unauthorized redirects are blocked at the source.
  • Revoked flag access — the LLM cannot touch sandbox flags or security policies at runtime. Zero prompt-injection surface for privilege escalation.
  • Zero-trust key storage — API keys live in ~/.config/albert/credentials.json, never in environment variables passed to subprocess.

LLM-Agnostic Core

Albert routes to any provider you configure. No vendor lock-in, no hardcoded defaults.

Provider Auth
Anthropic (Claude) API key
OpenAI (GPT-4o, o1) API key
Google (Gemini) API key
XAI (Grok) API key
HuggingFace API key
Ollama Local — no key needed
Azure OpenAI API key + endpoint
AWS Bedrock API key + region

Slash Command Library

Command Description
/auth [provider] Configure provider credentials
/init Build a cognitive map of the current repository
/plan <task> Deep multi-step execution plan with risk analysis
/tdd <interface> Scaffold → failing test → implement loop
/loop <mission> Autonomous agent loop until mission complete
/code-review Quality, security, and maintainability audit
/build-fix Detect build errors and dispatch resolver agents
/bughunter Hunt and triage bugs across the codebase
/refactor [scope] Remove dead code, consolidate duplicates
/commit AI-generated commit message from staged diff
/pr Draft and open a pull request
/compress Sliding-window context compaction
/status Current session state and active context
/help Full command reference

Memory & Context

  • Session persistence — conversations survive restarts, stored in ~/.config/albert/sessions/
  • Knowledge graph — entity/relation memory that tracks project-specific context across sessions
  • RepoMap — automated structural navigation so Albert understands your codebase before it touches it
  • MCP client — native Model Context Protocol support; plug in any third-party MCP server

RTK — Rust Token Killer

Integrated token-optimization proxy that intercepts outgoing context and applies structural filters. Typical savings: 60–90% on development operations like git status, cargo clippy, and file reads.


Cognitive Persistence & Identity

Albert builds a mental model of your project through two primary systems:

The Knowledge Graph (knowledge_graph.json)

This is Albert's Knowledge Base. When you say "lock this into memory," Albert uses a specialized tool to store structured facts, relationships, and observations.

  • Persistence: Stored in ~/.ternlang/memory/knowledge_graph.json.
  • Neurosymbolic Gap Recovery: If a tool enters an ambiguous state (State 0), Albert autonomously queries this graph. If he finds a matching entity or observation, he uses it to resolve the ambiguity and proceed to State +1 without bothering you.
  • Content: Tracks project team members, architectural decisions, and hardware context.

Identity & Working Agreement (ALBERT.md)

This is Albert's Core Directive. It is the instruction set that defines his "brain" configuration for the current workspace.

  • Customizable Behavior: By editing ALBERT.md in your project root, you can "re-program" Albert's personality, tone, and priorities.
  • Directives: You can set specific rules like "always use async/await" or "respond with dry wit."
  • Scope: Loaded dynamically on startup; changes take effect in the next session.

Reflection Log (memory.md)

A global, high-level summary of significant insights. Albert periodically runs a "reflection pass" (llm_reflect) to distill your conversations into single-line memories saved in ~/.ternlang/memory.md.


Installation

Prerequisites: Rust toolchain (cargo) — install here

# Install Albert (brings the full agent engine with it)
cargo install albert-cli


# Launch
albert-cli

Quickstart

# 1. Add your provider credentials
albert-cli /auth

# 2. Map the current repository
albert-cli /init

# 3. Start the REPL
albert-cli

On first launch Albert walks you through a setup sequence: cognitive style, provider routing, and model selection. After that, you drop straight into the REPL.


Repository layout

agent_albert_cli/
├── rust/
│   └── crates/
│       ├── api/              # Multi-provider LLM client (albert-api)
│       ├── runtime/          # Core loop, OAuth, MCP, session management (albert-runtime)
│       ├── commands/         # Slash command library (albert-commands)
│       ├── tools/            # Tool execution layer — bash, file ops, search (albert-tools)
│       ├── compat-harness/   # Manifest extraction and path resolution (albert-compat)
│       └── rusty-ternlang-cli/  # Main binary: albert (albert-cli)
├── src/                      # Python/legacy reference source
├── tests/                    # Validation surfaces
├── ALBERT.md                 # Agent working agreement for this repo
└── PARITY.md                 # Feature parity gap analysis vs. TypeScript origin

Ecosystem

Albert is one node in the Ternary Intelligence Stack — a full agentic platform built around ternary logic.

Component Description Link
TernStudio Visual flow IDE — drag-and-drop ternary agent graphs Live →
ternlang-api Rust/Axum backend — LLM routing, simulation, WebSocket tracer API →
Albert CLI Terminal agent — this repo

Development

cd rust

# Check everything compiles
cargo build --workspace

# Lint
cargo clippy --workspace --all-targets -- -D warnings

# Test
cargo test --workspace

The workspace uses resolver = "2" with unsafe_code = "forbid" and pedantic Clippy enforced across all crates.


A sovereign project of RFI-IRFOS — building the infrastructure for agentic intelligence.

About

albert-cli — multi-provider terminal client for albert. and other LLMs. Part of the Ternary Intelligence Stack.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors