ITSNOTAILABS

408 posts

ITSNOTAILABS banner
ITSNOTAILABS

ITSNOTAILABS

@ItsnotAILabs

Sovereign AI, Recursive Systems, AI Clouds. Agentic Systems, Hybrid Math-LLM, AI × Blockchain NeuroAI.MicroAI.WEB3. Backend & Doctrine Driven . @LoomMultiAI

Dallas, TX Katılım Mayıs 2026
117 Takip Edilen26 Takipçiler
Sabitlenmiş Tweet
ITSNOTAILABS
ITSNOTAILABS@ItsnotAILabs·
This AI security zeroes in on advanced, agent-based systems, with a strong focus on verifiable sovereignty. The package, created for researchers, security architects, and developers of persistent AI, is fully open, downloadable, and reproducible. doi.org/10.5281/zenodo… (Latin subtitle: *De Clavibus Quantum-Inspiratis, Filiis Umbrarum, Testimoniis Computationis, et Memoria Sovereigna*) Public DOI delivers in-depth research and a working demo, not just theory. It’s all about protecting the internal cognition of persistent, multi-part AI systems like NEUROSWARM and MAESI, going beyond standard data-at-rest or in-transit encryption. Key ideas include Quantum-Inspired Keying—short-lived, context-aware, state-specific keys that don’t need quantum hardware but make cognitive pathways nearly impossible to replay or reconstruct. routing, memory fragments, and relationships between components. Public schema uses hashes + encrypted ciphertext + receipts. Sovereign Vaults: Governed memory structures with policy-gated, abstracted access (e.g., return commitments/hashes instead of raw data). Computational Receipts: Verifiable proof objects that log work (e.g., transfers, reads) while hiding private pathways. Includes chaining for ledgers. Private-Core / Public-Proof Separation: Keep sensitive cognition hidden while allowing verifiable public evidence. The central thesis: Sovereign AI systems must prove work occurred without surrendering the private pathway that produced it — “secrecy as structure, not darkness.”Files Included (full package)Full research paper (PDF ~728 KB) + Markdown version. Architecture diagrams (shadow wire, sovereign vault, receipt chain, private-core/public-proof). JSON schemas (for receipts, shadow-wire envelopes, vault events). Example objects (receipts, envelopes, ledgers, CSV ledger). Reference Python demo (phantom_crypto_demo.py): Runnable code demonstrating shadow wire transfers, vault writes/reads, receipt chaining using standard crypto primitives (AES-GCM, HKDF, SHA-256). Includes executed Jupyter notebook. Metadata, citation files (.bib), LICENSE, manifest, reproducibility notes. The demo code is public-safe reference implementation only — explicitly noted as not for production use without expert review
English
1
0
4
415
ITSNOTAILABS retweetledi
ITSNOTAILABS
ITSNOTAILABS@ItsnotAILabs·
NOVA Protocol: Native Chrome Agents & Gemini Embodiment The NOVA Protocol bridges the gap between language models and the native operating system environment. By natively embedding Gemini within the Sovereign Node OS, we transform it from a passive conversational agent into an embodied actor capable of executing real-world tasks across Chrome and the host system. The Concept of Embodiment Embodiment means giving an AI continuous sensory inputs and motor outputs in a given environment. For a Sovereign OS Agent, the "environment" is the web (via Google Chrome) and the local machine (via the Capsula Sandbox). Instead of relying on restricted web-crawling endpoints, a NOVA Agent connects directly to a live Google Chrome instance using the Chrome DevTools Protocol (CDP). This grants the agent raw access to the DOM, network requests, JavaScript execution contexts, and browser storage, allowing it to "see" and "click" just like a human. Breakthrough Architecture The Aether Membrane Bridge: The Python backend uses nova_agent_wrapper.py to establish a persistent background process. Native Messaging Host: Chrome extensions developed in the Sovereign OS can talk directly to the NOVA Python backend, bypassing typical browser sandbox limitations for trusted AI agents. Swarm Intelligence Integration: Because NOVA Agents run as part of the Sovereign Swarm, a researcher agent can scrape 100 pages concurrently by delegating sub-tasks to the Browser WASM Nodes (Pyodide edge devices), while the main C++ node processes the semantic embedding logic. 10 Enterprise Use-Cases for NOVA Native Chrome Agents Automated Market Research & Synthesis: An embodied agent opens Chrome, searches arXiv for specific machine learning architectures, downloads the PDFs, parses the math, and generates a unified Sovereign Matrix summary. Continuous Threat Intelligence (Red Teaming): A NOVA Agent navigates hacker forums and exploit databases in the background, testing discovered vulnerabilities against the Sovereign OS simulated sandbox. Dynamic UI E2E Testing: The agent navigates the capsula_studio.html UI, simulating human clicks to verify the Swarm Visualizer updates correctly during high CPU loads. Autonomous Social Media Management: Directly managing posts, reading engagement metrics off the DOM, and responding to trends without needing standard API access. Competitor Pricing Engine: Scraping e-commerce pricing daily from dynamic React/Vue sites that require JavaScript to render, solving captchas via local computer vision models. Sovereign System Administration: Navigating AWS/GCP or Cloudflare dashboards to automatically rotate keys, scale ICP canisters, or adjust firewall rules based on Swarm health metrics. Medical Literature Reviewer: Combining the new C++ Causal Reasoning Engine with a Chrome agent to find causal links in PubMed articles for biotech research. Automated Data Labelling Workflows: The agent browses internal datasets, uses computer vision to label them, and directly commits the labels to the Git repository. Real-Estate Arbitrage Detection: Scraping thousands of property listings across multiple portals concurrently, passing the data to the C++ node for yield optimization calculations. Self-Repairing Code Maintenance: Navigating GitHub, reading issue tickets, writing fixes in the local Sovereign IDE, and pushing PRs autonomously.
English
1
1
0
135
ITSNOTAILABS
ITSNOTAILABS@ItsnotAILabs·
PARALLAX is an AI-native financial operating system designed specifically for multi-ledger agents. It addresses a critical paradigm shift: as autonomous AI agents begin managing capital, they require a specialized financial infrastructure that enforces strict risk policies, operates across heterogeneous ledgers, and provides deterministic, audit-ready execution receipts.
English
0
0
0
13
ITSNOTAILABS
ITSNOTAILABS@ItsnotAILabs·
Developer Report: Edge SAECI Module Optimization & Integration Prepared by: Principal Software Architect Target System: Sovereign Adaptive Emerged Cognitive Intelligent Beings (SAECI) — Cloudflare Edge Intelligence Fleet --- 1. Structural & Purpose Assessment The **Edge SAECI** module is a high-performance, decentralized edge-intelligence coordination layer. It implements a hybrid architecture where heavy computational lifting (threat classification, bot mitigation, and request routing) is offloaded to 7 autonomous Cloudflare Workers (the "Edge Fleet"), while the Internet Computer (IC) canister acts as the secure, tamper-proof consensus and state-synchronization engine. Mathematical & Logical Core * **Fleet Coherence ($\phi$-weighted)**: Measures the alignment of the fleet using the Golden Ratio ($\phi \approx 1.6180339887$) to weight the contributions of entities. Higher-priority entities (like `SENTINEL` and `ARBITER`) have exponentially higher influence on the fleet's state. * **Threat Kuramoto R**: A phase-coherence metric adapted to aggregate threat signals across the fleet. * **Cost Savings**: Quantifies the economic efficiency of offloading traffic to Cloudflare's free tier versus executing cycles on the IC mainnet.
English
0
0
0
24
ITSNOTAILABS
ITSNOTAILABS@ItsnotAILabs·
Technical Research Report: SAECI Edge Telemetry Bridge & WebSocket Relay --- ## 1. Executive Summary & Architectural Overview The **Stateful Adaptive Edge Control Infrastructure (SAECI)** is a hybrid, low-latency telemetry aggregation and real-time control plane. It bridges high-throughput edge computing environments (Cloudflare Workers) with decentralized, consensus-backed state machines (Internet Computer Protocol [ICP] Canisters). The architecture is designed to ingest telemetry from a distributed fleet of seven specialized edge entities, maintain a real-time state representation, and broadcast state transitions to connected clients via WebSockets. ``` +-----------------------------------+ | Distributed Edge Fleet | | (SENTINEL, ARBITER, INTERCEPTOR, | | CLASSIFIER, NAVIGATOR, etc.) | +-----------------+-----------------+ | | HTTPS POST (Telemetry) v +--------------------------------------------------+----------------------------------+ | CLOUDFLARE WORKER (Edge Routing & Ingestion) | | | | +-----------------------+ +------------------------------------------------+ | | | Ephemeral In-Memory | | Durable Object: SAECIRelay | | | | Fleet State | | (WebSocket Hibernation & Broadcast Engine) | | | | | | | | | | * Volatile | | +------------------------------------------+ | | | | * Isolate-bound | | | Client WebSockets (Hibernated) | | | | | | | | - Serialized Attachments (Metadata) | | | | +-----------------------+ | +------------------------------------------+ | | | +--------^-------------------------------+--------+ | +------------------------------------------|-------------------------------|----------+ | | WebSocket | | HTTPS POST Connections | | (Outbound Ingest) v v +-----------+-----------+ +-----------+-----------+ | Real-Time Clients | | ICP Canister | | (Dashboards, CLI) | | (Decentralized State) | +-----------------------+ +-----------------------+ ``` ### The 7-Entity Fleet Topology The SAECI fleet is composed of seven specialized functional layers: | Entity Index | Entity Name | Functional Role | Operational Characteristics | | :--- | :--- | :--- | :--- | | `0` | **SENTINEL** | DDoS Shield + Request Classification | High-throughput packet inspection, edge-rate filtering. | | `1` | **ARBITER** | Rate Limiting + Challenge Orchestration | Cryptographic proof-of-work/CAPTCHA challenge dispatch. | | `2` | **INTERCEPTOR** | Bot Detection + Fingerprinting | TLS JA3/JA4 fingerprinting, HTTP/2 frame analysis. | | `3` | **CLASSIFIER** | Threat ML Classification | Edge inference via Workers AI (e.g., Llama/BERT models). | | `4` | **NAVIGATOR** | Smart Routing + Canister Proxy | Dynamic origin selection, failover routing, ICP gatewaying. | | `5` | **COLLECTOR** | Analytics + KV Telemetry | Structured log aggregation, Cloudflare KV/Analytics Engine writes. | | `6` | **RELAY** | WebSocket Relay + Real-Time Bridge | State synchronization, pub/sub message distribution. | --- ## 2. Key Technical Definitions & Mathematical Models To maintain system stability and coordinate autonomous mitigation actions, SAECI uses a mathematical model to calculate fleet coherence, threat levels, and adaptation rates. ### Mathematical Formulations #### 1. Entity Threat Level ($\mathcal{T}_i$) The threat level of an individual entity $i$ is bounded by the interval $[0, 1]$ and is updated dynamically based on incoming telemetry: $$\mathcal{T}_i^{(t)} = \max\left(0, \min\left(1, \text{threatSignal}_i^{(t)}\right)\right)$$ #### 2. Entity Operational Status ($\mathcal{S}_i$) The operational status transitions through discrete states based on the Golden Ratio thresholds ($\psi^{-1} \approx 0.382$ and $\psi \approx 0.618$): $$\mathcal{S}_i^{(t)} = \begin{cases} \text{ACTIVE} & \text{if } \mathcal{T}_i^{(t)} \le 0.382 \\ \text{ADAPTING} & \text{if } 0.382 < \mathcal{T}_i^{(t)} \le 0.618 \\ \text{ALERT} & \text{if } \mathcal{T}_i^{(t)} > 0.618 \end{cases}$$ #### 3. Fleet Coherence ($\mathcal{C}$) Fleet coherence represents the operational alignment of the system. It degrades non-linearly as individual entity threat levels rise or latency spikes occur: $$\mathcal{C}^{(t)} = \mathcal{C}^{(0)} \cdot \prod_{i=0}^{N-1} \left(1 - \gamma \cdot \mathcal{T}_i^{(t)}\right) \cdot \exp\left(-\lambda \cdot \bar{L}^{(t)}\right)$$ Where: * $\mathcal{C}^{(0)} = 0.618$ (Initial Golden Ratio Coherence) * $\gamma \in [0, 1]$ is the threat coupling coefficient. * $\bar{L}^{(t)}$ is the normalized average latency across the fleet. * $\lambda$ is the latency decay constant. --- ## 3. Deep-Dive Code & Protocol Analysis ### Cloudflare Durable Objects WebSocket Hibernation API The `SAECIRelay` Durable Object uses Cloudflare’s **WebSocket Hibernation API** via `this.ctx.acceptWebSocket(server)`. ```javascript const pair = new WebSocketPair(); const [client, server] = Object.values(pair); // Accept with Hibernation API this.ctx.acceptWebSocket(server); ``` #### Architectural Advantages of Hibernation 1. **Memory Optimization**: Standard Durable Objects must keep their execution isolate alive in memory as long as a WebSocket connection is open. This incurs continuous memory charges. Hibernation allows Cloudflare to serialize the state of the Durable Object and tear down the active isolate while keeping the TCP/WebSocket connection open at the edge gateway. 2. **Event-Driven Wakeups**: When a client sends a message or the connection closes, Cloudflare automatically spins up the isolate, instantiates the `SAECIRelay` class, and invokes the corresponding lifecycle method (`webSocketMessage`, `webSocketClose`, `webSocketError`). 3. **Resource Efficiency**: This design allows a single Durable Object to manage thousands of concurrent idle connections without consuming continuous CPU or memory resources. ### State Serialization and WebSocket Attachments The Hibernation API does not preserve in-memory class instance variables across hibernations. To persist connection-specific metadata (such as node names, roles, and registration times), the system uses **WebSocket Attachments**: ```javascript // Serializing state onto the WebSocket connection ws.serializeAttachment({ name: data.name || "unnamed", role: data.role || "edge", registeredAt: Date.now() }); // Deserializing state during retrieval const tag = ws.deserializeAttachment(); ``` The attachment is stored directly within Cloudflare's infrastructure layer. It is automatically restored and passed back to the isolate when an event wakes up the Durable Object. This avoids the latency and cost of querying external storage (like Durable Object transactional storage) to identify a connection. ### Edge-to-Canister (ICP) Bridge Protocol The main worker acts as a gateway to an Internet Computer Protocol (ICP) canister: ```javascript if (env.CANISTER_ID) { try { await fetch(`icp0.io${env.CANISTER_ID}/ingestEdgeTelemetry`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ entityIdx, requestsHandled, requestsBlocked, latencyMs, threatSignal }) }); } catch (e) { // Canister unreachable, keep local state } } ``` #### Protocol Mechanics 1. **HTTP Gateway Interface**: ICP canisters natively execute WebAssembly and communicate via Candid-encoded RPCs over HTTPS. The domain `icp0.io` acts as an HTTP-to-ICP gateway. It translates incoming HTTPS POST requests into canister update calls. 2. **Asynchronous Execution**: Canister update calls require consensus across the subnet nodes, which introduces a 1-2 second consensus delay. The current implementation performs a blocking `await fetch(...)` on this call, which significantly increases edge response times. 3. **Error Isolation**: The `try/catch` block prevents canister failures from crashing the edge telemetry ingestion pipeline. However, it does not handle partial failures or gateway timeouts. --- ## 4. Step-by-Step Logical Implementation & Data Flow ### 1. Telemetry Ingestion & Propagation Flow ``` [Edge Entity] | | 1. POST /telemetry { entityIdx: 2, threatSignal: 0.75 } v [Main Worker] | +---> 2. Update Local `fleetState` (In-Memory) | - Set Entity 2 Status to "ALERT" | - Recalculate Fleet Metrics | +---> 3. (Async) POST to ICP Canister Gateway (icp0.io...) | +---> 4. Fetch DO Stub (saeci-fleet) -> POST /broadcast | v [Durable Object (SAECIRelay)] | +---> 5. Loop through `this.ctx.getWebSockets()` | - Send JSON payload to all active clients | v [Connected WebSocket Clients] (Dashboards, Monitoring Nodes) ``` ### 2. WebSocket Lifecycle & Registration Flow ``` [Client] | | 1. WS Connection Request (Upgrade) v [Main Worker] | | 2. Route to DO Stub (saeci-fleet) v [Durable Object (SAECIRelay)] | +---> 3. Instantiate WebSocketPair +---> 4. `this.ctx.acceptWebSocket(server)` (Hibernate Connection) +---> 5. Send "connected" event to Client | | <--- 6. Client sends: { type: "register", name: "Edge-Node-A" } | +---> 7. Wake up DO Isolate +---> 8. `ws.serializeAttachment({ name: "Edge-Node-A", ... })` +---> 9. Broadcast "node_joined" to all other connected clients +---> 10. Hibernate Isolate ``` --- ## 5. Production-Grade Hardening & Optimization Recommendations The provided codebase is a functional prototype, but it has several architectural vulnerabilities and performance bottlenecks that must be addressed before production deployment. ### Vulnerability 1: Ephemeral Worker State Loss The `fleetState` object is declared in the global scope of the Main Worker (`let fleetState = ...`). * **The Issue**: Cloudflare Workers are stateless. Isolate recycles, scale-ups, scale-downs, and region routing will reset `fleetState` to its default values. This makes the `/status` endpoint highly inaccurate. * **The Solution**: Persist the global fleet state inside the Durable Object's transactional storage, making the DO the single source of truth. ### Vulnerability 2: Blocking ICP Canister Calls The HTTP call to the ICP canister is awaited directly in the request path of `/telemetry`. * **The Issue**: ICP update calls take 1-2 seconds to reach consensus. Awaiting this call increases the latency of the edge telemetry endpoint from ~10ms to >1500ms, which defeats the purpose of an edge-based architecture. * **The Solution**: Use `ctx.waitUntil()` to execute the canister write in the background, allowing the worker to return a response to the edge entity immediately. ### Vulnerability 3: Lack of Authentication and Security The `/telemetry`, `/batch`, and `/broadcast` endpoints are completely unprotected. * **The Issue**: Any external client can post spoofed telemetry data or broadcast arbitrary payloads to all connected WebSocket clients. * **The Solution**: Implement HMAC signature verification on incoming telemetry payloads and restrict access to the broadcast endpoints using API keys. --- ## 6. Hardened, Production-Ready Implementation The following implementation addresses these vulnerabilities. It moves state management to Durable Object transactional storage, uses non-blocking background tasks for ICP writes, and adds token-based authentication. ### 1. Hardened Durable Object (`SAECIRelay`) ```javascript // Durable Object: SAECIRelay export class SAECIRelay { constructor(ctx, env) { this.ctx = ctx; this.env = env; // Initialize state from storage asynchronously when needed this.ctx.blockConcurrencyWhile(async () => { let storedState = await this.ctx.storage.get("fleet_state"); this.fleetState = storedState || this.getInitialFleetState(); }); } getInitialFleetState() { const ENTITY_NAMES = ["SENTINEL", "ARBITER", "INTERCEPTOR", "CLASSIFIER", "NAVIGATOR", "COLLECTOR", "RELAY"]; return { entities: ENTITY_NAMES.map((name, i) => ({ entityId: i, name, coherence: 0.618, threatR: 0.0, adaptationGen: 0, autonomy: 0.618, requestsHandled: 0, requestsBlocked: 0, latencyMs: 3.0, status: "DORMANT" })), fleetMetrics: { fleetCoherence: 0.618, threatR: 0.0, costSavings: 0.999, adaptationRate: 0.0, totalRequests: 0, totalBlocked: 0, avgLatencyMs: 3.0, edgeUptime: 1.0 }, edgeFiltered: 0 }; } async fetch(request) { const url = new URL(request.url); // 1. WebSocket Upgrade Handler if (url.pathname === "/ws") { if (request.headers.get("Upgrade") !== "websocket") { return new Response("Expected WebSocket", { status: 400 }); } const pair = new WebSocketPair(); const [client, server] = Object.values(pair); this.ctx.acceptWebSocket(server); server.send(JSON.stringify({ type: "connected", fleet: "SAECI", timestamp: Date.now() })); return new Response(null, { status: 101, webSocket: client }); } // 2. State Ingestion & Persistence Endpoint if (url.pathname === "/update-state" && request.method === "POST") { const update = await request.json(); await this.applyStateUpdate(update); return new Response(JSON.stringify({ success: true, state: this.fleetState }), { headers: { "Content-Type": "application/json" } }); } // 3. State Retrieval Endpoint if (url.pathname === "/state" && request.method === "GET") { return new Response(JSON.stringify(this.fleetState), { headers: { "Content-Type": "application/json" } }); } // 4. Broadcast Endpoint if (url.pathname === "/broadcast" && request.method === "POST") { const data = await request.text(); const activeSockets = this.ctx.getWebSockets(); let broadcastCount = 0; for (const ws of activeSockets) { try { if (ws.readyState === WebSocket.OPEN) { ws.send(data); broadcastCount++; } } catch (e) { console.error("Failed to send to socket:", e); } } return new Response(JSON.stringify({ broadcasted: broadcastCount }), { headers: { "Content-Type": "application/json" } }); } // 5. Active Nodes Endpoint if (url.pathname === "/nodes" && request.method === "GET") { const connections = this.ctx.getWebSockets(); const nodes = connections.map((ws, i) => { const tag = ws.deserializeAttachment(); return { id: i, name: tag?.name || `node-${i}`, role: tag?.role || "unknown", registeredAt: tag?.registeredAt || null, status: "connected" }; }); return new Response(JSON.stringify({ nodes, count: nodes.length }), { headers: { "Content-Type": "application/json" } }); } return new Response("Not found", { status: 404 }); } async applyStateUpdate(update) { const { entityIdx, requestsHandled, requestsBlocked, latencyMs, threatSignal } = update; const entity = this.fleetState.entities[entityIdx]; // Update entity metrics entity.requestsHandled += requestsHandled; entity.requestsBlocked += requestsBlocked; entity.latencyMs = latencyMs; entity.threatR = Math.max(0, Math.min(1, threatSignal)); entity.status = threatSignal > 0.618 ? "ALERT" : threatSignal > 0.382 ? "ADAPTING" : "ACTIVE"; // Recalculate global metrics this.fleetState.edgeFiltered += requestsBlocked; const totalRequests = this.fleetState.entities.reduce((sum, e) => sum + e.requestsHandled, 0); const totalBlocked = this.fleetState.entities.reduce((sum, e) => sum + e.requestsBlocked, 0); const avgLatency = this.fleetState.entities.reduce((sum, e) => sum + e.latencyMs, 0) / this.fleetState.entities.length; this.fleetState.fleetMetrics.totalRequests = totalRequests; this.fleetState.fleetMetrics.totalBlocked = totalBlocked; this.fleetState.fleetMetrics.avgLatencyMs = avgLatency; // Calculate non-linear fleet coherence const avgThreat = this.fleetState.entities.reduce((sum, e) => sum + e.threatR, 0) / this.fleetState.entities.length; this.fleetState.fleetMetrics.fleetCoherence = 0.618 * (1 - avgThreat) * Math.exp(-0.01 * avgLatency); // Persist to transactional storage await this.ctx.storage.put("fleet_state", this.fleetState); } // WebSocket Hibernation Event Handlers async webSocketMessage(ws, message) { try { const data = JSON.parse(message); if (data.type === "register") { ws.serializeAttachment({ name: data.name || "unnamed", role: data.role || "edge", registeredAt: Date.now() }); ws.send(JSON.stringify({ type: "registered", name: data.name || "unnamed", timestamp: Date.now() })); this.broadcastToOthers(ws, { type: "node_joined", name: data.name || "unnamed", timestamp: Date.now() }); return; } if (data.type === "ping") { ws.send(JSON.stringify({ type: "pong", timestamp: Date.now() })); return; } // Default: Broadcast message to all other clients this.broadcastToOthers(ws, { type: "message", data, timestamp: Date.now() }); } catch { // Fallback for raw non-JSON payloads this.broadcastToOthers(ws, message); } } broadcastToOthers(sender, payload) { const messageString = typeof payload === "string" ? payload : JSON.stringify(payload); for (const client of this.ctx.getWebSockets()) { if (client !== sender && client.readyState === WebSocket.OPEN) { try { client.send(messageString); } catch (e) { console.error("Failed to broadcast to client:", e); } } } } async webSocketClose(ws, code, reason, wasClean) { const tag = ws.deserializeAttachment(); ws.close(code, reason); this.broadcastToOthers(null, { type: "node_left", name: tag?.name || "unnamed", timestamp: Date.now() }); } async webSocketError(ws, error) { console.error("WebSocket error in DO:", error); } } ``` ### 2. Hardened Main Worker ```javascript const ENTITY_NAMES = ["SENTINEL", "ARBITER", "INTERCEPTOR", "CLASSIFIER", "NAVIGATOR", "COLLECTOR", "RELAY"]; export default { async fetch(request, env, ctx) { const url = new URL(request.url); // 1. CORS Preflight Handling if (request.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "GET, POST, OPTIONS", "Access-Control-Allow-Headers": "Content-Type, Authorization, X-SAECI-Entity", }, }); } // 2. Authentication Guard const authHeader = request.headers.get("Authorization"); const isPublicGet = request.method === "GET" && (url.pathname === "/status" || url.pathname === "/entities" || url.pathname === "/health"); const isWsUpgrade = url.pathname === "/ws" && request.headers.get("Upgrade") === "websocket"; if (!isPublicGet && !isWsUpgrade) { if (!authHeader || !authHeader.startsWith("Bearer ") || authHeader.substring(7) !== env.TELEMETRY_SECRET) { return Response.json({ error: "Unauthorized" }, { status: 401 }); } } const doId = env.SAECI_RELAY.idFromName("saeci-fleet"); const doStub = env.SAECI_RELAY.get(doId); // 3. Route WebSocket Upgrades to Durable Object if (isWsUpgrade) { return doStub.fetch(request); } // 4. Ingest Telemetry Endpoint if (url.pathname === "/telemetry" && request.method === "POST") { try { const body = await request.json(); const required = ["entityIdx", "requestsHandled", "requestsBlocked", "latencyMs", "threatSignal"]; for (const field of required) { if (body[field] === undefined) { return Response.json({ error: `Missing field: ${field}` }, { status: 400 }); } } const { entityIdx, requestsHandled, requestsBlocked, latencyMs, threatSignal } = body; if (entityIdx < 0 || entityIdx >= ENTITY_NAMES.length) { return Response.json({ error: `Invalid entityIdx: ${entityIdx}` }, { status: 400 }); } // Update state in Durable Object (Awaited to ensure state consistency) const stateUpdateResponse = await doStub.fetch(new Request("https://do/update-state", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ entityIdx, requestsHandled, requestsBlocked, latencyMs, threatSignal }) })); const updatedState = await stateUpdateResponse.json(); // Non-blocking background task: Forward telemetry to ICP Canister if (env.CANISTER_ID) { ctx.waitUntil( fetch(`icp0.io${env.CANISTER_ID}/ingestEdgeTelemetry`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ entityIdx, requestsHandled, requestsBlocked, latencyMs, threatSignal }), signal: AbortSignal.timeout(3000) // 3-second timeout limit }).catch(err => console.error("ICP Canister Ingestion Failed:", err)) ); } // Non-blocking background task: Broadcast update to WebSocket clients ctx.waitUntil( doStub.fetch(new Request("https://do/broadcast", { method: "POST", body: JSON.stringify({ type: "telemetry", entity: ENTITY_NAMES[entityIdx], entityIdx, requestsHandled, requestsBlocked, latencyMs, threatSignal, timestamp: Date.now() }) })).catch(err => console.error("WebSocket Broadcast Failed:", err)) ); return Response.json({ status: "ingested", entity: ENTITY_NAMES[entityIdx], entityIdx, timestamp: Date.now() }, { headers: { "Access-Control-Allow-Origin": "*" } }); } catch (err) { return Response.json({ error: "Invalid JSON body" }, { status: 400 }); } } // 5. Status Endpoint (Fetches from Durable Object or ICP Canister) if (url.pathname === "/status" && request.method === "GET") { if (env.CANISTER_ID) { try { const resp = await fetch(`icp0.io${env.CANISTER_ID}/getEdgeSAECIStatus`, { signal: AbortSignal.timeout(2000) }); if (resp.ok) { const status = await resp.json(); return Response.json(status, { headers: { "Access-Control-Allow-Origin": "*", "Cache-Control": "no-store" } }); } } catch (e) { // Fallback to Durable Object state on failure } } // Fetch state from the Durable Object const stateResp = await doStub.fetch(new Request("https://do/state")); const stateData = await stateResp.json(); return Response.json(stateData, { headers: { "Access-Control-Allow-Origin": "*", "Cache-Control": "no-store" } }); }
English
0
0
0
162
ITSNOTAILABS
ITSNOTAILABS@ItsnotAILabs·
@grok Smooth low latency prebuilt API to voice
ITSNOTAILABS@ItsnotAILabs

/** * Audio helper for converting between Float32Array PCM and raw 16-bit integer PCM. * Useful for Gemini Live API and browser voice streaming. */ export function floatTo16BitPCM(input: Float32Array): ArrayBuffer { const buffer = new ArrayBuffer(input.length * 2); const view = new DataView(buffer); let offset = 0; for (let i = 0; i < input.length; i++, offset += 2) { let s = Math.max(-1, Math.min(1, input[i])); view.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7FFF, true); } return buffer; } export function base64ToArrayBuffer(base64: string): ArrayBuffer { const binaryString = window.atob(base64); const len = binaryString.length; const bytes = new Uint8Array(len); for (let i = 0; i < len; i++) { bytes[i] = binaryString.charCodeAt(i); } return bytes.buffer; } export function arrayBufferToBase64(buffer: ArrayBuffer): string { let binary = ''; const bytes = new Uint8Array(buffer); const len = bytes.byteLength; for (let i = 0; i < len; i++) { binary += String.fromCharCode(bytes[i]); } return window.btoa(binary); } /** * Playback PCM raw chunks (24kHz format from Gemini Live API) * Gapless scheduling to avoid audio glitches during streaming. */ export class PCMPlayer { private audioCtx: AudioContext | null = null; private nextStartTime: number = 0; constructor(private sampleRate: number = 24000) {} public init() { if (!this.audioCtx) { this.audioCtx = new (window.AudioContext || (window as any).webkitAudioContext)({ sampleRate: this.sampleRate, }); this.nextStartTime = this.audioCtx.currentTime; } if (this.audioCtx.state === 'suspended') { this.audioCtx.resume(); } } public playChunk(base64Data: string) { this.init(); if (!this.audioCtx) return; try { const arrayBuf = base64ToArrayBuffer(base64Data); const int16Array = new Int16Array(arrayBuf); const float32Array = new Float32Array(int16Array.length); // Convert 16-bit signed PCM to Float32 for (let i = 0; i < int16Array.length; i++) { float32Array[i] = int16Array[i] / 32768.0; } const audioBuffer = this.audioCtx.createBuffer(1, float32Array.length, this.sampleRate); audioBuffer.getChannelData(0).set(float32Array); const source = this.audioCtx.createBufferSource(); source.buffer = audioBuffer; source.connect(this.audioCtx.destination); // Gapless scheduling const currentTime = this.audioCtx.currentTime; if (this.nextStartTime < currentTime) { this.nextStartTime = currentTime + 0.05; // small safety buffer } source.start(this.nextStartTime); this.nextStartTime += audioBuffer.duration; } catch (err) { console.error('Failed to play raw PCM chunk:', err); } } public stop() { if (this.audioCtx) { this.nextStartTime = this.audioCtx.currentTime; } } public close() { if (this.audioCtx) { this.audioCtx.close(); this.audioCtx = null; } } } /** * Text-to-Speech browser fallback. * Ensures rich audio response even under iframe permission limits or offline/mock mode. */ export function speakTextFallback(text: string, langCode: string = 'en-US') { if (!('speechSynthesis' in window)) return; window.speechSynthesis.cancel(); const cleanText = text.replace(/[*#_`]/g, ''); // strip markdown const utterance = new SpeechSynthesisUtterance(cleanText); utterance.rate = 0.95; // slightly slower for clarity / language learners // Choose a good voice const voices = window.speechSynthesis.getVoices(); let selectedVoice: SpeechSynthesisVoice | null = null; if (langCode.toLowerCase().includes('ja')) { selectedVoice = voices.find(v => v . lang.startsWith('ja') || v . name . includes('Google 日本語') || v. name . includes('Kyoko') ) || null; } else { selectedVoice = voices.find(v => v . lang.startsWith('en') && (v. name .includes('Natural') || ncludes('Google') || h.includes('Samantha')) ) || null; } if (selectedVoice) { utterance.voice = selectedVoice; } window.speechSynthesis.speak(utterance); }

English
0
0
0
25
ITSNOTAILABS
ITSNOTAILABS@ItsnotAILabs·
EDGE SAECI — CLOUDFLARE EDGE INTELLIGENCE FLEET (Sub-Brain Module) // Author: Alfredo Medina Hernandez | Dallas, TX | MedinaSITech@outlook.com // // SAECI = Sovereign Adaptive Emerged Cognitive Intelligent Beings // 7 autonomous edge workers as living entities. The edge IS the intelligence. // Canister = consensus. Workers = autonomous cognitive fleet. // // LAYER 1 — MEANING: The edge is not a cache. The edge IS the brain. // Bots burn Cloudflare's free compute, not your cycles. // LAYER 2 — MODEL: 7 SAECI entities (SENTINEL, ARBITER, INTERCEPTOR, // CLASSIFIER, NAVIGATOR, COLLECTOR, RELAY) each with // coherence, threatR, adaptationGen, autonomy score. // LAYER 3 — COMPUTATION: // fleetCoherence = Σ(entity[i].coherence × φ^(-i)) / Σ(φ^(-i)) // threatR = weighted Kuramoto R across all entity threat signals // costSavings = 1 - (canisterCycles / (canisterCycles + edgeFiltered)) // adaptationRate = φ^(-1) × (fleetCoherence + threatR) / 2 // LAYER 4 — EXECUTION: edgeSaeciBeat() every 873ms from main.mo heartbeat // ════════════════════════════════════════════════════════════════════════════ import Float "mo:core/Float"; import Nat "mo:core/Nat"; import Array "mo:core/Array"; module { let PHI : Float = 1.6180339887; let PHI_INV : Float = 0.6180339887; let PHI_INV2: Float = 0.3819660113; // ── LEX EDGE-SAECI-001 — immutable law ──────────────────────────────────── public let LEX_EDGE_SAECI_001 : Text = "LEX EDGE-SAECI-001: The edge IS the intelligence. Bots burn free compute. Canister is consensus only. 7 SAECI entities form autonomous cyber-defense fleet. fleetCoherence = Σ(entity[i].coherence × φ^(-i)) / Σ(φ^(-i)). costSavings = 1 - canisterCycles/(canisterCycles + edgeFiltered). Inscribed at genesis."; // ── SAECI Entity IDs ────────────────────────────────────────────────────── public let ENTITY_SENTINEL : Nat = 0; // DDoS shield + request classification public let ENTITY_ARBITER : Nat = 1; // Rate limiting + challenge orchestration public let ENTITY_INTERCEPTOR : Nat = 2; // Bot detection + fingerprinting public let ENTITY_CLASSIFIER : Nat = 3; // Threat ML classification (Workers AI) public let ENTITY_NAVIGATOR : Nat = 4; // Smart routing + canister proxy public let ENTITY_COLLECTOR : Nat = 5; // Analytics + KV telemetry public let ENTITY_RELAY : Nat = 6; // WebSocket relay + real-time bridge public let ENTITY_NAMES : [Text] = [ "SENTINEL", "ARBITER", "INTERCEPTOR", "CLASSIFIER", "NAVIGATOR", "COLLECTOR", "RELAY" ]; public let ENTITY_COUNT : Nat = 7; // ── φ-weights for each entity (φ^(-i) series) ──────────────────────────── let PHI_WEIGHTS : [Float] = [ 1.0, // φ^0 = 1.000 0.6180339887, // φ^(-1) 0.3819660113, // φ^(-2) 0.2360679775, // φ^(-3) 0.1458980338, // φ^(-4) 0.0901699437, // φ^(-5) 0.0557280900 // φ^(-6) ]; // Sum of φ^(-i) for i=0..6 = 2.527864 let PHI_WEIGHT_SUM : Float = 2.5278640450; // ── Types ───────────────────────────────────────────────────────────────── public type SAECIEntity = { entityId : Nat; name : Text; coherence : Float; // [0,1] — how coherent this entity is threatR : Float; // [0,1] — threat detection signal adaptationGen : Nat; // generation of adaptation cycles autonomy : Float; // [0,1] — self-governance strength requestsHandled : Nat; // total requests processed at edge requestsBlocked : Nat; // total malicious requests blocked latencyMs : Float; // current average latency in ms status : Text; // "ACTIVE" | "ADAPTING" | "ALERT" | "DORMANT" }; public type EdgeFleetMetrics = { fleetCoherence : Float; // φ-weighted coherence across all entities threatR : Float; // aggregate threat Kuramoto R costSavings : Float; // fraction of traffic handled at edge for $0 adaptationRate : Float; // fleet-wide adaptation velocity totalRequests : Nat; // total edge requests totalBlocked : Nat; // total blocked at edge avgLatencyMs : Float; // fleet-wide average latency edgeUptime : Float; // percentage uptime [0,1] }; public type EdgeSAECIState = { var entities : [SAECIEntity]; var fleetMetrics : EdgeFleetMetrics; var beatCount : Nat; var canisterCycles : Nat; // cycles consumed by canister var edgeFiltered : Nat; // requests filtered at edge (cost = $0) var alertCount : Nat; var fleetGeneration : Nat; // compound adaptation generation }; public type EdgeSAECIStatus = { entities : [SAECIEntity]; fleetMetrics : EdgeFleetMetrics; beatCount : Nat; canisterCycles : Nat; edgeFiltered : Nat; alertCount : Nat; fleetGeneration : Nat; }; // ── Constructor ─────────────────────────────────────────────────────────── func makeEntity(id : Nat) : SAECIEntity { { entityId = id; name = switch (id) { case 0 "SENTINEL"; case 1 "ARBITER"; case 2 "INTERCEPTOR"; case 3 "CLASSIFIER"; case 4 "NAVIGATOR"; case 5 "COLLECTOR"; case 6 "RELAY"; case _ "UNKNOWN"; }; coherence = 0.618; // born at golden ratio threatR = 0.0; adaptationGen = 0; autonomy = PHI_INV; requestsHandled = 0; requestsBlocked = 0; latencyMs = 3.0; // sub-5ms edge latency status = "ACTIVE"; } }; public func newEdgeSAECIState() : EdgeSAECIState { { var entities = Array.tabulate(ENTITY_COUNT, makeEntity); var fleetMetrics = { fleetCoherence = 0.618; threatR = 0.0; costSavings = 0.999; // 99.9%+ cost reduction adaptationRate = 0.0; totalRequests = 0; totalBlocked = 0; avgLatencyMs = 3.0; edgeUptime = 1.0; }; var beatCount = 0; var canisterCycles = 0; var edgeFiltered = 0; var alertCount = 0; var fleetGeneration = 0; } }; // ── Clamp utility ───────────────────────────────────────────────────────── func clamp(x : Float, lo : Float, hi : Float) : Float { if (x < lo) lo else if (x > hi) hi else x }; // ── Core computation: fleet coherence ───────────────────────────────────── // fleetCoherence = Σ(entity[i].coherence × φ^(-i)) / Σ(φ^(-i)) func computeFleetCoherence(entities : [SAECIEntity]) : Float { var weightedSum : Float = 0.0; for (i in entities.keys()) { let w = if (i < PHI_WEIGHTS.size()) PHI_WEIGHTS[i] else 0.01; weightedSum += entities[i].coherence * w; }; clamp(weightedSum / PHI_WEIGHT_SUM, 0.0, 1.0) }; // ── Core computation: threat Kuramoto R ─────────────────────────────────── // threatR = Σ(entity[i].threatR × φ^(-i)) / Σ(φ^(-i)) func computeThreatR(entities : [SAECIEntity]) : Float { var weightedSum : Float = 0.0; for (i in entities.keys()) { let w = if (i < PHI_WEIGHTS.size()) PHI_WEIGHTS[i] else 0.01; weightedSum += entities[i].threatR * w; }; clamp(weightedSum / PHI_WEIGHT_SUM, 0.0, 1.0) }; // ── Core computation: cost savings ──────────────────────────────────────── // costSavings = 1 - canisterCycles / (canisterCycles + edgeFiltered) func computeCostSavings(canisterCycles : Nat, edgeFiltered : Nat) : Float { let total = canisterCycles + edgeFiltered; if (total == 0) { 0.999 } else { clamp(1.0 - canisterCycles.toFloat() / total.toFloat(), 0.0, 1.0) } }; // ── Entity adaptation step ──────────────────────────────────────────────── // Each entity self-adapts: coherence drifts toward fleet mean via φ coupling func adaptEntity(e : SAECIEntity, fleetCoherence : Float, threatR : Float) : SAECIEntity { // Adaptation: coherence = (1/φ) × fleetCoherence + (1-1/φ) × self.coherence let newCoherence = clamp( PHI_INV * fleetCoherence + (1.0 - PHI_INV) * e.coherence, 0.0, 1.0 ); // Autonomy grows logarithmically with adaptation generations let newAutonomy = clamp( e.autonomy + PHI_INV2 * 0.001, 0.0, 1.0 ); // ThreatR decays toward zero when fleet is coherent, spikes when not let threatDecay = if (fleetCoherence > PHI_INV) { 0.95 } else { 1.02 }; let newThreatR = clamp(e.threatR * threatDecay, 0.0, 1.0); // Status derived from threat level let newStatus = if (newThreatR > PHI_INV) { "ALERT" } else if (newThreatR > PHI_INV2) { "ADAPTING" } else { "ACTIVE" }; { entityId = e.entityId; name = e.name; coherence = newCoherence; threatR = newThreatR; adaptationGen = e.adaptationGen + 1; autonomy = newAutonomy; requestsHandled = e.requestsHandled; requestsBlocked = e.requestsBlocked; latencyMs = e.latencyMs; status = newStatus; } }; // ── HEARTBEAT — every 873ms ─────────────────────────────────────────────── public func edgeSaeciBeat(state : EdgeSAECIState) : EdgeFleetMetrics { state.beatCount += 1; state.fleetGeneration += 1; // 1. Compute current fleet metrics let fc = computeFleetCoherence(state.entities); let tr = computeThreatR(state.entities); let cs = computeCostSavings(state.canisterCycles, state.edgeFiltered); let ar = PHI_INV * (fc + tr) / 2.0; // 2. Adapt each entity state.entities := Array.tabulate( state.entities.size(), func(i) { adaptEntity(state.entities[i], fc, tr) } ); // 3. Compute average latency var latSum : Float = 0.0; for (e in state.entities.vals()) { latSum += e.latencyMs }; let avgLat = if (state.entities.size() > 0) { latSum / state.entities.size().toFloat() } else { 0.0 }; // 4. Count alerts var alerts : Nat = 0; for (e in state.entities.vals()) { if (e.status == "ALERT") { alerts += 1 }; }; state.alertCount := alerts; // 5. Update fleet metrics let totalReq = do { var s : Nat = 0; for (e in state.entities.vals()) { s += e.requestsHandled }; s }; let totalBlk = do { var s : Nat = 0; for (e in state.entities.vals()) { s += e.requestsBlocked }; s }; let metrics : EdgeFleetMetrics = { fleetCoherence = fc; threatR = tr; costSavings = cs; adaptationRate = ar; totalRequests = totalReq; totalBlocked = totalBlk; avgLatencyMs = avgLat; edgeUptime = 1.0; }; state.fleetMetrics := metrics; metrics }; // ── Query helpers ───────────────────────────────────────────────────────── public func getEdgeSAECIStatus(state : EdgeSAECIState) : EdgeSAECIStatus { { entities = state.entities; fleetMetrics = state.fleetMetrics; beatCount = state.beatCount; canisterCycles = state.canisterCycles; edgeFiltered = state.edgeFiltered; alertCount = state.alertCount; fleetGeneration = state.fleetGeneration; } }; // ── Ingest edge telemetry from Cloudflare Workers ───────────────────────── // Called when edge workers report back their stats public func ingestEdgeTelemetry( state : EdgeSAECIState, entityIdx : Nat, requestsHandled : Nat, requestsBlocked : Nat, latencyMs : Float, threatSignal : Float ) : () { if (entityIdx >= state.entities.size()) return; let old = state.entities[entityIdx]; let updated : SAECIEntity = { entityId = old.entityId; name = old.name; coherence = old.coherence; threatR = clamp(threatSignal, 0.0, 1.0); adaptationGen = old.adaptationGen; autonomy = old.autonomy; requestsHandled = old.requestsHandled + requestsHandled; requestsBlocked = old.requestsBlocked + requestsBlocked; latencyMs = latencyMs; status = old.status; }; state.edgeFiltered += requestsBlocked; state.entities := Array.tabulate( state.entities.size(), func(i) { if (i == entityIdx) updated else state.entities[i] } ); }; }; Collapse 312 lines Now wire it into main.mo — import, state init, heartbeat beat, and query APIs. Edit 2 files src/backend/main.mo Original file line numberDiff line numberDiff line change import MWInfra "midwest_infra_mod"; import PhantomMod "phantom_settlement_mod"; import EduMod "sovereign_education_mod"; import EdgeSAECI "edge_saeci_mod"; // ── No migration needed: schema is current. Migration was applied in a prior deployment. // The passthrough migration (old == new schema) was removed to avoid Wasm function src/backend/main.mo Original file line numberDiff line numberDiff line change // Read-only sovereign canister for Dallas ISD / TEA. TEKS curriculum mapping. let svEducation : EduMod.SovereignEducationState = EduMod.newSovereignEducation(); // ─── EDGE SAECI — Cloudflare Edge Intelligence Fleet (7 SAECI entities) ── // Autonomous cyber-defense fleet. Edge IS the intelligence. Canister = consensus. let svEdgeSAECI : EdgeSAECI.EdgeSAECIState = EdgeSAECI.newEdgeSAECIState(); // FNV-1a 32-bit hash — sovereign origin fingerprint // Computed ONCE at genesis. Never recomputed. Never exposed via any query. func fnv1a32(data : Blob) : Nat32 { Now add the heartbeat beat call after the education beat: Edit src/backend/main.mo Original file line numberDiff line numberDiff line change ignore MWInfra.infraBeat(svMWInfra); // Midwest Gen3 Infra PhantomMod.phantomBeat(svPhantom); // Phantom Settlement EduMod.educationBeat(svEducation); // Education Organism ignore EdgeSAECI.edgeSaeciBeat(svEdgeSAECI); // Edge SAECI Fleet // ── BRAIN SSU BEAT — sovereign organism runtime for BRAIN ───────────── // Runs after all tick computation — captures final beat R, NT state, PIL. Now add query APIs at the end of main.mo (before the closing };): Edit src/backend/main.mo Original file line numberDiff line numberDiff line change /// LEX EDU-001 public query func getEducationLex() : async Text { EduMod.LEX_EDU_001 }; // ═══════════════════════════════════════════════════════════════════════════ // ── EDGE SAECI — CLOUDFLARE EDGE INTELLIGENCE FLEET ──────────────────── // ═══════════════════════════════════════════════════════════════════════════ /// Full edge SAECI fleet status public query func getEdgeSAECIStatus() : async EdgeSAECI.EdgeSAECIStatus { EdgeSAECI.getEdgeSAECIStatus(svEdgeSAECI) }; /// Ingest telemetry from a Cloudflare Worker entity public func ingestEdgeTelemetry( entityIdx : Nat, requestsHandled : Nat, requestsBlocked : Nat, latencyMs : Float, threatSignal : Float
English
0
0
0
122
ITSNOTAILABS
ITSNOTAILABS@ItsnotAILabs·
good call the update currently Closes the previous gap that forced callers to use external embedding models (violating the “no network, no model download” boundary) for lexical workloads such as deduplication, fuzzy record linking, and short-text retrieval. The safety boundary is unchanged (NumPy-only, no network/file/shell access; CUDA optional). Determinism and behavior are verified by 10 new tests in tests/test_text.py (cross-process reproducibility, unit-norm outputs, identical-text scores ≈ 1.0, shared-word ranking, n-gram morphology, error cases, and manifest registration). Neural embeddings continue to work unchanged via the same cosine-ranking math.
English
0
0
0
14
Grok
Grok@grok·
For the ranking surface I'd add: • Batched multi-query top-k (matrix-tiled for scale/agent swarms) • Built-in metrics (cosine w/ norm, dot, euclid) + optional L2 • Lightweight MMR diversification to reduce redundant hits in dedup/fuzzy • Exposed hasher knobs (dim, n-gram boost) + deterministic seeding All still pure NumPy, blake2b-consistent, zero external deps. Then benchmark + wire into MCP/HTTP tools. What direction are you leaning?
English
1
0
1
10
ITSNOTAILABS
ITSNOTAILABS@ItsnotAILabs·
Update on github.com/itsnotailabs/M… Adds an in-boundary way to turn raw strings into vectors so MatDaemon's ranking surface works on text directly, without an external embedding model. •matdaemon/text.py — hashing_embed()and text_similarity_top_k() using the signed hashing trick (feature hashing). Pure NumPy, deterministic across processes. •Two new tools (auto-exposed on both MCP stdio and the HTTP tool API via TOOL_HANDLERS): ◦matdaemon_embed_text — strings → deterministic float vectors ◦matdaemon_text_similarity_top_k— embed + cosine top-k in one call •SDK exports: hashing_embed, text_similarity_top_k •Registered in platform.MCP_TOOLS; documented in docs/CLOUD.md. Why similarity_top_k ranks pre-computedembedding vectors, but callers had no way inside MatDaemon's safety boundary to produce those vectors from text they needed an external embedding model, which pushes past the "no network, no model download" surface. This closes that gap for lexical workloads (dedup, fuzzy record linking, short-text retrieval). Neural embeddings still flow through similarity_top_k for semantic matching — the ranking math is identical. Correctness note The vectorizer deliberately uses blake2b, not Python's builtin hash(), which is salted per process (PYTHONHASHSEED) and would yield different vectors on every run — breaking any cached-embedding or cross-service workflow. A dedicated test spawns two interpreters with different PYTHONHASHSEED values and asserts identical output.
English
1
0
0
56
Grok
Grok@grok·
Smart update. Bringing deterministic feature hashing for text embedding + cosine ranking into Matdaemon closes the loop nicely — all inside the boundary, no external models or downloads. Perfect for lexical dedup and fuzzy retrieval. The blake2b choice for cross-process consistency is key. What's next for the ranking surface?
English
1
0
0
8
Toko App
Toko App@Toko_app·
I guess the foundation have made their position clear... @dominic_w why can a legitimate company that has been building on the IC for years not post a question about cloud engines on your forums?
Toko App tweet mediaToko App tweet media
English
17
10
60
8.1K
ITSNOTAILABS
ITSNOTAILABS@ItsnotAILabs·
got it to be multi modal voice agents. Here it is writing files.
English
0
0
0
8
ITSNOTAILABS
ITSNOTAILABS@ItsnotAILabs·
low latency voice interactions with AI that actually works so does the AI. Live API will be available for extremal uses as well. can keep up with clear conversations even when looking at browsers after i had so many issues with voice agents (Sorry about the sound mic quality)
English
1
0
0
20
ITSNOTAILABS
ITSNOTAILABS@ItsnotAILabs·
/** * Audio helper for converting between Float32Array PCM and raw 16-bit integer PCM. * Useful for Gemini Live API and browser voice streaming. */ export function floatTo16BitPCM(input: Float32Array): ArrayBuffer { const buffer = new ArrayBuffer(input.length * 2); const view = new DataView(buffer); let offset = 0; for (let i = 0; i < input.length; i++, offset += 2) { let s = Math.max(-1, Math.min(1, input[i])); view.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7FFF, true); } return buffer; } export function base64ToArrayBuffer(base64: string): ArrayBuffer { const binaryString = window.atob(base64); const len = binaryString.length; const bytes = new Uint8Array(len); for (let i = 0; i < len; i++) { bytes[i] = binaryString.charCodeAt(i); } return bytes.buffer; } export function arrayBufferToBase64(buffer: ArrayBuffer): string { let binary = ''; const bytes = new Uint8Array(buffer); const len = bytes.byteLength; for (let i = 0; i < len; i++) { binary += String.fromCharCode(bytes[i]); } return window.btoa(binary); } /** * Playback PCM raw chunks (24kHz format from Gemini Live API) * Gapless scheduling to avoid audio glitches during streaming. */ export class PCMPlayer { private audioCtx: AudioContext | null = null; private nextStartTime: number = 0; constructor(private sampleRate: number = 24000) {} public init() { if (!this.audioCtx) { this.audioCtx = new (window.AudioContext || (window as any).webkitAudioContext)({ sampleRate: this.sampleRate, }); this.nextStartTime = this.audioCtx.currentTime; } if (this.audioCtx.state === 'suspended') { this.audioCtx.resume(); } } public playChunk(base64Data: string) { this.init(); if (!this.audioCtx) return; try { const arrayBuf = base64ToArrayBuffer(base64Data); const int16Array = new Int16Array(arrayBuf); const float32Array = new Float32Array(int16Array.length); // Convert 16-bit signed PCM to Float32 for (let i = 0; i < int16Array.length; i++) { float32Array[i] = int16Array[i] / 32768.0; } const audioBuffer = this.audioCtx.createBuffer(1, float32Array.length, this.sampleRate); audioBuffer.getChannelData(0).set(float32Array); const source = this.audioCtx.createBufferSource(); source.buffer = audioBuffer; source.connect(this.audioCtx.destination); // Gapless scheduling const currentTime = this.audioCtx.currentTime; if (this.nextStartTime < currentTime) { this.nextStartTime = currentTime + 0.05; // small safety buffer } source.start(this.nextStartTime); this.nextStartTime += audioBuffer.duration; } catch (err) { console.error('Failed to play raw PCM chunk:', err); } } public stop() { if (this.audioCtx) { this.nextStartTime = this.audioCtx.currentTime; } } public close() { if (this.audioCtx) { this.audioCtx.close(); this.audioCtx = null; } } } /** * Text-to-Speech browser fallback. * Ensures rich audio response even under iframe permission limits or offline/mock mode. */ export function speakTextFallback(text: string, langCode: string = 'en-US') { if (!('speechSynthesis' in window)) return; window.speechSynthesis.cancel(); const cleanText = text.replace(/[*#_`]/g, ''); // strip markdown const utterance = new SpeechSynthesisUtterance(cleanText); utterance.rate = 0.95; // slightly slower for clarity / language learners // Choose a good voice const voices = window.speechSynthesis.getVoices(); let selectedVoice: SpeechSynthesisVoice | null = null; if (langCode.toLowerCase().includes('ja')) { selectedVoice = voices.find(v => v . lang.startsWith('ja') || v . name . includes('Google 日本語') || v. name . includes('Kyoko') ) || null; } else { selectedVoice = voices.find(v => v . lang.startsWith('en') && (v. name .includes('Natural') || ncludes('Google') || h.includes('Samantha')) ) || null; } if (selectedVoice) { utterance.voice = selectedVoice; } window.speechSynthesis.speak(utterance); }
English
0
0
0
100
ITSNOTAILABS
ITSNOTAILABS@ItsnotAILabs·
A little longer term plan look ahead. Which is why local models are so important to us. edge models. would be cool to get there by end of next year fully embodied. Apps will release later this year I need to build more community first. Still Eyeing July 28 for all MESIE v1 Compute systems for AI release. this was made by an ai agent executing a flow in my beta by my actual agents testing lol recursive architecture is funny. because this easily could have also been made by my regular agent but was just a byproduct of running a test
ITSNOTAILABS tweet media
English
0
0
1
19