SubAIVA Cloudflare Workers — LIVE

type: infrastructure

description: SubAIVA deployed to Cloudflare Workers with Durable Objects. Per-customer AI agents with isolated SQLite memory, Workers AI (Llama 3.3 70B), KV entitlements, and swarm knowledge ingestion. URL: https://subaiva.kinan-ae7.workers.dev

status: PRODUCTION


Swarm Knowledge Ingestion Endpoint

type: capability

description: POST /api/swarm/ingest — massively parallel knowledge processing on Cloudflare edge. Send array of documents, each gets AI-summarized via Workers AI (Llama 3.3 70B), key facts extracted, stored in KnowledgeStore Durable Object with SQLite. Proven: 705 docs in 4.7 min, 50 concurrent, zero failures.

method: POST

auth: Bearer subaiva-prod-token-2026-genesis

title: document title

content: raw text content

705_docs_time: 4.7 minutes


Swarm Knowledge Search Endpoint

description: POST /api/swarm/search — search ingested knowledge by keyword across summaries, key facts, and titles. Returns ranked results with source, category, and processing timestamp.

query: search terms


Swarm Knowledge Stats Endpoint

description: GET /api/swarm/stats — returns total documents, total jobs, total tokens, documents by category from the KnowledgeStore.

method: GET


KnowledgeStore Durable Object

description: Global singleton Durable Object (name: genesis-knowledge) with SQLite tables: documents (id, source, source_type, title, content, summary, key_facts, category, tokens_used, processed_at, created_at), embeddings_queue (doc_id, content, status, created_at), swarm_jobs (id, total_docs, completed, failed, total_tokens, started_at, completed_at, status). Indexes on category and source_type.

singleton_name: genesis-knowledge


SubAIVA Customer Provisioning

description: POST /api/provision — create a new SubAIVA for a customer. Each customer gets isolated Durable Object with private SQLite memory, conversation history, and tier-gated capabilities. Body: {customerId, tier (1-3), systemPrompt?}. Tier 1: Starter (Llama 8B, 500 memories), Tier 2: Professional (Llama 70B, 5000 memories), Tier 3: Enterprise (Llama 70B, 50000 memories, voice).


SubAIVA Chat Endpoint

description: POST /api/:customerId/chat — send a message to a customer's SubAIVA and get AI response. Uses Workers AI with tier-appropriate model. Supports memory-augmented responses (auto-retrieves relevant memories). Body: {message: string}.


How To Use Swarm Ingestion

type: axiom

description: Any Genesis agent can ingest knowledge into the Cloudflare edge KB. Steps: 1) Read file content, 2) POST to /api/swarm/ingest with Bearer token, 3) Include documents array with source, sourceType, title, content, category fields. Max 50 docs per batch for optimal parallelism. The endpoint handles AI summarization + key fact extraction automatically. Use curl or Python requests. Example: curl -X POST https://subaiva.kinan-ae7.workers.dev/api/swarm/ingest -H 'Authorization: Bearer subaiva-prod-token-2026-genesis' -H 'Content-Type: application/json' -d '{"documents":[{"source":"path","sourceType":"markdown","title":"Title","content":"...","category":"ghl"}]}'