{"_id":"@criticalinsight/aarondb-edge","name":"@criticalinsight/aarondb-edge","dist-tags":{"latest":"1.1.0"},"versions":{"1.1.0":{"name":"@criticalinsight/aarondb-edge","version":"1.1.0","description":"Edge-native Datalog engine for sovereign agents. De-coupled from Cloudflare Workers but compatible.","main":"./src/index.js","module":"./src/index.js","type":"module","exports":{".":"./src/index.js","./worker":"./src/worker.js","./engine":"./build/dev/javascript/aarondb_edge/aarondb_edge/engine.mjs"},"scripts":{"build":"gleam build","dev":"wrangler dev src/worker.js","deploy":"wrangler deploy src/worker.js","test":"bun test test/coverage.test.ts","test:coverage":"bun test test/coverage.test.ts --coverage"},"dependencies":{"@stukennedy/honi":"^0.5.0","honi-cf":"^0.4.0"},"devDependencies":{"wrangler":"^4.71.0"},"gitHead":"dafbba3f02da02c8812ef1026deb2062c41ea96b","_id":"@criticalinsight/aarondb-edge@1.1.0","_nodeVersion":"25.8.0","_npmVersion":"11.11.0","dist":{"integrity":"sha512-3woWgY2PNjbdyIexazYeX42K8j3gDxwuNxMA0MlUDr8oIJT/jtB3+5B4MHndf1cVDLgIzHM3J8+XHEEWW3pWVg==","shasum":"c6842b4476383cda68d531766dc288d35f9007e6","tarball":"https://registry.npmjs.org/@criticalinsight/aarondb-edge/-/aarondb-edge-1.1.0.tgz","fileCount":383,"unpackedSize":2793940,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD2XTOgNeLEZVq1fCGygaDkYShrJbqRHGsi/tjQu4YHpQIhAPHH1PqBiCg7z4YgJRggAbHSN9luth91ifIPyxBtxiHQ"}]},"_npmUser":{"name":"criticalinsight","email":"iamkingori@gmail.com"},"directories":{},"maintainers":[{"name":"criticalinsight","email":"iamkingori@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/aarondb-edge_1.1.0_1773082304583_0.2025836929748288"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-09T18:51:44.420Z","1.1.0":"2026-03-09T18:51:44.807Z","modified":"2026-03-09T18:51:45.038Z"},"maintainers":[{"name":"criticalinsight","email":"iamkingori@gmail.com"}],"description":"Edge-native Datalog engine for sovereign agents. De-coupled from Cloudflare Workers but compatible.","readme":"# Rich Hickey Gap Analysis: AaronDB Edge & The Sovereign Stack\n\nThis analysis evaluates **AaronDB Edge** against Cloudflare-compatible alternatives through the lens of Rich Hickey's philosophy: **Simplicity**, **Immutability**, and **De-complecting State**.\n\n## 🧙🏾‍♂️ Competitor Overview (Cloudflare Edge Edition)\n\n| Competitor | Core Paradigm | CF Integration | Primary Weakness (Hickey Lens) |\n| :--- | :--- | :--- | :--- |\n| **Turso** | Distributed SQL (LibSQL) | Native Workers Support | **Complected**: Logic and Storage are tightly braided. |\n| **InstantDB** | Local-first Datalog | JS Client in Workers | **Situational**: Focuses on UI state over backend reasoning. |\n| **Convex** | Reactive Document | HTTP/Action Client | **Opaque**: Reactivity braids transport with logic. |\n| **Supabase** | Managed Postgres | Edge Functions (Deno) | **Easy, not Simple**: Wraps massive legacy complexity. |\n| **Upstash** | Serverless Redis/Vec | REST / HTTP | **Atomic, but Unrelated**: No native join between vector and facts. |\n\n---\n\n## 🏗️ Feature Set Comparison (Edge Logic)\n\n| Feature | AaronDB Edge | Turso | InstantDB | Convex | Supabase | Upstash |\n| :--- | :---: | :---: | :---: | :---: | :---: | :---: |\n| **Paradigm** | Datalog | SQL | Datalog | Reactive | SQL | KV/Vec |\n| **Sovereign Isolate**| ✅ (Durable Object)| ❌ (Shared DB) | ❌ (Client-only) | ❌ (Black Box) | ❌ (Global PG) | ❌ |\n| **Time Travel** | ✅ (Tx-as-Value) | ❌ | ❌ | ✅ | ❌ | ❌ |\n| **Vector-Logic Join**| ✅ (Integrated) | ❌ (SQL only) | ❌ | ❌ | ❌ | ❌ |\n| **0-Cold Start** | ✅ (Isolate) | ✅ | ✅ | ✅ | ❌ | ✅ |\n\n---\n\n## 🧠 Rich Hickey Analysis: The \"Gap\"\n\n### 1. Simple vs. Easy (Infrastructure Sovereignty)\n- **The Competitors**: Turso and Supabase offer \"Easy\" solutions. They manage the complex machinery for you. However, you are **complected** with their infrastructure.\n- **AaronDB Edge**: It is **Simple**. It is a library (Gleam) that runs inside *your* Durable Object. You own the state and the engine.\n\n### 2. Information vs Situational Models\n- **Upstash/Pinecone** treat data as **Situational** (vectors are approximations).\n- **AaronDB** treats data as **Information**. Even semantic lookups are grounded in a Datalog provenance (`tx` ID), ensuring the \"guess\" is verifiable against fact.\n\n### 3. Databases as Values\n- **AaronDB Edge** treats the state as an **Expanding Value**. By querying `as_of(tx)`, you are querying a stable value. Managed SQL databases are \"Update-in-Place\" machines that destroy information by mutating records.\n\n---\n\n## 📊 Complexity vs. Utility\n\n| System | Implementation Complexity | Architectural Utility | The \"Efficiency\" |\n| :--- | :--- | :--- | :--- |\n| **Turso** | High (Managed LibSQL) | Moderate (Standard SQL) | Low (SQL is noisy at edge) |\n| **AaronDB** | **Low (Embedded Engine)** | **Maximum (Logical RAG)** | **High (O(1) in-RAM logic)** |\n| **Supabase** | Very High (Full PG) | High (Relational) | Low (Heavy infra overlap) |\n| **InstantDB**| Low (Graph-like) | Moderate (Sync only) | High (Client-side) |\n\n---\n\n## ⚖️ Benefits and Trade-offs\n\n| System | Benefit | Rich Hickey Trade-off |\n| :--- | :--- | :--- |\n| **AaronDB** | **Micro-Tenancy Sovereignty** | Requires learning Datalog (Logical overhead). |\n| **Turso** | Low-latency SQL read replicas | Mutates state (Destroys history). |\n| **Convex** | Automatic UI reactivity | Opaque transport (De-complects nothing). |\n| **Upstash** | Extreme scale for vectors | Disconnected from logical constraints. |\n\n---\n\n## 🚀 Actionable Recommendation\n\n**Weighted Analysis Score:**\n- **Power (Logic + Vector)**: 9/10\n- **Speed (Edge Latency)**: 10/10\n- **Simplicity (Hickey Metric)**: 9/10\n- **Cost (Native CF Bound)**: 9/10\n\n### Final Verdict:\nFor **Agentic RAG on Cloudflare**, AaronDB Edge is the optimal choice. It provides the only stack where an LLM can reason over **Immutable Transactions** in sub-millisecond RAM isolates.\n\n> [!IMPORTANT]\n> **Rich Hickey's Warning**: Do not fall for the \"Ease\" of a managed Vector DB. The complexity of syncing your logical database with a vector store will eventually \"braid\" your system into a corner. Stay Sovereign. Use AaronDB.\n\n---\n\n## 🗺️ System Architecture Map\n\nAaronDB Edge is designed as a **Sovereign Isolate** on Cloudflare, packaging logic, state, and persistence into a single cohesive unit.\n\n```mermaid\ngraph TD\n    User((User/Agent)) -->|HTTP Request| Honi[Honi API Gateway]\n    \n    subgraph \"Cloudflare Worker\"\n        Honi -->|Middleware| KV[\"CONFIG_KV (Discovery)\"]\n        Honi -->|Context Injection| Client[AaronDB Client]\n    end\n\n    Client -->|Route Action| DO[AaronDBState Durable Object]\n    \n    subgraph \"Sovereign Isolate (Durable Object)\"\n        DO -->|Query| Engine[Gleam Datalog Engine]\n        DO -->|Insert| MemoryIndex[In-Memory EAVT Index]\n        DO -->|Async Durability| D1[(D1 Fact Log)]\n        DO -->|Deep Freeze| R2[\"ARCHIVE (R2 Snapshots)\"]\n        DO -->|Reasoning| AI[Workers AI: BGE / Llama-3]\n    end\n\n    AI -->|Semantic Match| Engine\n    D1 -->|Rehydrate| MemoryIndex\n    R2 -->|Cold Load| MemoryIndex\n```\n\n### The Role of Honi\n[Honi](https://github.com/stukennedy/honi) is the **Routing and Middleware Layer** that defines the RESTful interface and de-complects the complexity of Durable Object resolution.\n\n### Workers AI & Vectorize Integration\nThe Durable Object uses **Workers AI** to generate embeddings on the fly, which are then **upserted to Cloudflare Vectorize**, creating a native semantic index for high-speed similarity lookups.\n\n### The \"Dark\" Components (Future & Internal)\n- **Database Cracking**: Internal JIT physical reorganization of RAM data based on query patterns.\n- **Semantic Prefetching**: Predictive warming of DO memory based on reasoning context.\n\n### Integrated Stack Hierarchies\n\n| Layer | Service | Status | Role |\n| :--- | :--- | :--- | :--- |\n| **Routing** | **Honi** | Active | Request lifecycle and Context management. |\n| **Discovery** | **KV Namespace** | Active | Resolving agent names to stable DO IDs. |\n| **Hot State** | **Durable Objects** | Active | Consistent in-memory execution. |\n| **Durability** | **D1 Database** | Active | The immutable fact log. |\n| **Cold Storage** | **R2 Bucket** | Active | Periodic state checkpoints. |\n| **Intelligence** | **Workers AI** | Active | On-the-fly vector embedding. |\n| **Semantic Cache**| **Vectorize** | **Active** | Native high-performance vector search. |\n| **Optimization** | **Cracking Engine**| *Internal* | Adaptive self-indexing logic. |\n","readmeFilename":"README.md","_rev":"1-01b9848461169a6155b9d568934fa56e"}