Skip to content

Overview

ARKHEIN is a NativePHP desktop application for macOS that prioritizes privacy and local intelligence. It combines the power of local LLMs via Ollama with a high-performance, pure PHP vector store (Vektor) to create a conversational and active assistant that lives entirely on your machine.

What It Is

  • Sovereign Agent: Operates independently of cloud services.
  • Local-First RAG: Uses managed folders to build context-aware intelligence.
  • Architectural Depth: A complex macOS agent hidden behind minimalist APIs.
  • Privacy Centric: All data, embeddings, and inference stay on your macOS device.

What It Isn't

  • Cloud Dependent: No data leaves your machine for core processing.
  • Thin Wrapper: More than just a chat UI; it manages complex memory and filesystem lifecycles.
  • Web App: Built specifically for the macOS native experience via NativePHP.

Architecture

Arkhein follows a "Deep over Shallow" philosophy. Logic is encapsulated within specialized service "black boxes" (Knowledge, Memory, Archive, Prompt) while controllers and jobs act as thin orchestrators.

Core Components

1. SQLite SSOT

The nativephp SQLite connection serves as the Single Source of Truth. All searchable knowledge, metadata, and embeddings are persisted here before being indexed for fast retrieval.

2. Vektor Accelerator

A disposable, high-performance binary vector index. It acts as an accelerator for SQLite, providing fast semantic search. It can be rebuilt at any time from the SSOT.

3. Managed Folders Boundary

A security-first approach to the filesystem. Arkhein only interacts with directories explicitly authorized by the user, ensuring a strict safety boundary for all indexing and actions.

Cognitive Architecture

1. The 7-Level Sovereign Pipeline

Arkhein implements a formal 7-level hierarchical reasoning pipeline (Level 0–7) that ensures accurate, reliable, and sovereign decision-making:

  • Level 0 (Grounding): EnvironmentScanner generates Silo Semantic Maps for naming and purpose detection.
  • Level 1 (Perception): Structural analysis of intent and complexity detection.
  • Level 2 (Context): Strategy selection (Manifest, RAG, or Hybrid) to eliminate noise.
  • Level 3 (Canopy): Silo Discovery pass using synthesized high-level folder summaries.
  • Level 4 (Decomposition): Intent-aware task breakdown into multi-phase reasoning plans.
  • Level 5 (Scratchpad): Physical reasoning within durable on-disk internal workspaces.
  • Level 6 (Self-Critique): Hallucination auditing and accuracy verification pass.
  • Level 7 (Generation): Final synthesis with high-signal content and professional T.O.V.

2. Sovereign Tree (Hierarchical RAG)

Arkhein utilizes a hierarchical semantic indexing model to ensure precise retrieval:

  • Canopy Discovery: A pre-recall step identifying the relevant silos to search.
  • Silo Manifest: Ground-truth file lists for 100% structural accuracy.
  • Adaptive Retrieval: Dynamically adjusting fragment limits based on query intent.

3. Self-Healing & Integrity

  • Self-Healing Protocol: Lightweight disk signatures and HealSiloJob for autonomous sync.
  • Shadow Rebuilds: Zero-downtime vector indexing using atomic directory swapping.
  • Silo Guard: Strict path traversal protection via realpath normalization.

Tech Stack

ComponentTechnology
FrameworkLaravel 12
RuntimeNativePHP (macOS)
DatabaseSQLite (SSOT)
Vector StoreVektor (Pure PHP)
InferenceOllama (Local LLM)

Use Case

Arkhein is designed for users who require high-density information retrieval and autonomous task execution within local, private environments—such as managing sensitive documentation, local codebases, or personal knowledge archives.