PomaiDB
Documentation v0.1.0

Introduction: The Predictable Edge-Native Engine

PomaiDB is the predictable, edge-native database engineered specifically for multimodal Artificial Intelligence (AI) Memory. Developed from the ground up natively in C++20, PomaiDB is a highly-optimized, embedded, single-threaded vector and document store tailored for extreme environments: IoT sensor gateways, autonomous robotics platforms, industrial shop-floor deployments, and offline-first AI appliances.

Unlike distributed, cluster-oriented vector databases (like Pinecone or Milvus) that rely on massive thread parallelism, sprawling network consensus algorithms, and virtually unlimited RAM scaling, PomaiDB deliberately makes a fundamentally different architectural tradeoff. It assumes only a single process and a single thread of execution.

The Philosophy of Constraint
By constraining the engine to a single monolithic loop, PomaiDB eliminates complex multi-threading deadlock reasoning entirely. It provides strictly predictable microsecond-level latency, mathematically bounds its memory allocations preventing catastrophic Out-Of-Memory (OOM) kernel panics, and enforces an I/O model mathematically guaranteeing that fragile flash storage mediums (such as MicroSD cards and eMMC drives) survive years of continuous, heavy ingestion without suffering physical silicon failure.

Why Relational & Distributed Engines Fail on the Edge

  • SD-Card Erase Phenomenon: Traditional databases continuously execute "Random In-Place Overwrites" updating B-Trees dynamically. Wear leveling on embedded devices instantly fractures, creating write-amplification that destroys the drive. PomaiDB utilizes Log-Structured, Append-Only storage—the exact sequential I/O pattern your hardware was built for.
  • Volatile Heaps vs Static Arenas: Complex queries in traditional vector search engines dynamically allocate RAM, eventually triggering the OS OOM-Killer. PomaiDB integrates with palloc for O(1) contiguous configurations. If the engine breaches its capacity, it initiates structural Backpressure, stalling writes until hardware flushes complete securely.
  • Dependency on Cloud Inference: Constructing AI memories usually implies calling remote LLMs (like OpenAI) to chunk text, generate embeddings, and score semantic similarities. PomaiDB ships with an Offline-First Edge RAG Pipeline—empowering engineers to absorb text, format it securely, embed the context, and rank similarities locally using Zero-Copy std::string_view execution.

Rapid Integration Verification (C++ and Python)

Deploying PomaiDB takes mere seconds. Because it is a statically linked executable engine lacking a separate "Server Daemon", engineers simply import the runtime via pomai/pomai.h or through the pomaidb Python package using automatedctypes FFI protocols.

python
# 1. Edge IoT Initialization (Python C-Bindings)
import pomaidb

# Initialize the engine allocating exactly 128 MB of RAM boundaries
# Targeting 768-dimensional AI Embeddings strictly partitioned across 2 Local Logical Shards
db = pomaidb.open_db(
    path="/mnt/nvme01/pomaidb/drone_logs", 
    dim=768, 
    shards=2, 
    max_memtable_mb=128
)

# 2. Declare distinct multimodal storage domains
# Organizing data natively separated into 'telemetry' vectors and 'system_rag' documentation
pomaidb.create_rag_membrane(db, "system_rag", dim=768, shard_count=2)

# 3. Absorb vast offline context entirely without network HTTP reliance
pomaidb.ingest_document(
    db=db, 
    membrane="system_rag", 
    doc_id=9001, 
    text="Critical subsystem parameter limits set to alpha boundaries."
)

# Seamless, highly predictable Zero-Copy Context retrieval
retrieved = pomaidb.retrieve_context(db, "system_rag", "What are the parameter limits?", top_k=1)
pomaidb.close(db)
High-Level Production Specifications
Core Execution LayerC++20 Native (ISO/IEC 14882:2020)
Operating ArchitectureARMv8+ natively optimized; x86_64 AVX2 supported
Primary Storage TargetsFlash Storage (MicroSD, eMMC, Consumer SATA SSDs)
Execution TypologyStrictly Single-Threaded Event Loop (Zero Mutex Model)
Phase 3 CapabilitiesBuilt-in Edge Ingress Listeners (MQTT/HTTP JSON Interfaces)