Chapter 1

AI Foundations

How poqpoq World builds companions that reason, remember, and perceive — at scale, in real time.

poqpoq World — a builder avatar standing on a Doric plaza, with the Build panel docked left and the character sheet docked right
A builder standing on a Doric plaza. The Build panel docks on the left; the Akashic character sheet docks on the right. The same identity edits the world and climbs its progression curve — a duality that drives several of the design rules in this book.

The Problem

For twenty years, virtual worlds have been experientially empty. Artists filled them with architecture and landscapes, but the characters do not think, the spaces do not respond, and the result feels more like wandering through a museum after hours than inhabiting a living world.

poqpoq World takes an AI-first approach. Rather than building a world and hoping people fill it, we built a platform where the world itself is alive with intelligence. Every companion reasons about your relationship, remembers your conversations, and perceives the space around them just as you do.

The Challenge

Creating a single intelligent companion is straightforward when you can throw unlimited compute at one conversation. The difficulty emerges at scale: hundreds of concurrent users, each with unique relationships, conversation histories, and spatial context.

100+ Concurrent Users
< 2s Target Response
30/min Perception Updates
70% Compute Reduction

Without careful engineering, a naive implementation demands massive infrastructure and still delivers sluggish responses. Our companions achieve sub-two-second response times, efficient memory retrieval, and intelligent spatial filtering — while maintaining rich, personalized relationships with every user.

Five Core Principles

The companion system is built on five principles that work together to make real-time, personalized AI possible at scale.

1

Semantic Memory Over Keyword Storage

Conversations are encoded into 768-dimensional vectors that capture meaning, not just words. When a companion searches for relevant memories, it finds semantically similar experiences. A question about "weather" retrieves memories about sunny days, climate, and forecasts — concepts that keyword search would miss entirely.

2

Significance-Based Filtering

Not all memories carry equal weight. Each is automatically scored on a 0.0 to 1.0 scale based on emotional weight and commitment language. A casual "hmm" scores 0.1; "I promise to help you" scores 0.9. Companions prioritize what truly matters in your relationship.

3

Attention-Driven Perception

Human attention is not constant — we focus intensely during important moments, then relax into background awareness. Companions mirror this with three attention levels: high urgency (5-second updates when you speak), active (12-second updates during interaction), and baseline (120-second updates when idle). This biological model reduces unnecessary computation by 70%.

4

Hybrid Retrieval

Memory search combines two strategies: vector similarity at 70% weight finds semantically related memories through approximate nearest-neighbor search, while keyword matching at 30% weight ensures exact terms are never missed. The combination delivers both broad understanding and precise factual recall.

5

Large Model, Small Context

A capable language model with a carefully curated ~2,000-token context window outperforms a smaller model drowning in massive, noisy input. Think of it this way: a master chef creates a memorable meal from five perfect ingredients, while a novice struggles even with a fully stocked pantry. Quality of context matters more than quantity.

Architecture Overview

The companion system operates across three layers, rendered in real time by Babylon.js with WebGPU acceleration. Optimization happens at every stage — from the moment a character is typed to the final token streaming back to the screen.

Frontend Layer
Chat UI
Predictive Caching
Spatial Awareness
Real-Time Communication
API Layer
Embedding Generation
Memory Retrieval
Streaming Responses
Storage Layer
PostgreSQL
FAISS Vector Index
Language Model

Reading Guide

This documentation is structured as a technical narrative. Each chapter builds on the previous ones.

Chapter 2 Memory and embeddings architecture — how companions store, retrieve, and prioritize conversational history.
Chapter 3 Attention and perception systems — how companions sense and filter spatial information using adaptive update rates.
Chapter 4 Model philosophy — why a large model with small, curated context outperforms the alternatives.
Chapter 5 FAISS optimization — the technical infrastructure behind sub-second semantic memory search.
Chapter 6 Identity and personality — maintaining consistent companion character across unpredictable conversations.
Chapter 7 Knowledge seeding — bootstrapping companion world knowledge through retrieval-augmented generation.
Chapter 8 RAG architecture — retrieval-augmented generation, why it beats fine-tuning, and how knowledge seeding works at scale.
Chapter 9 From knowledge to agency — the architectural leap from companions that answer questions to companions that reshape shared virtual worlds through natural language.
Chapter 10 Dungeon Mouths & the infinite quest loop — object donation, sacrifice mechanics, seed-based reality, and the economic flywheel that turns building into questing.
Chapter 11 Dungeon instances — private party adventures: instanced PvE zones with NPC spawning, checkpoints, and party-scoped loot.
Chapter 12 Bridging worlds — when two rendering engines disagree about a single convention, the disagreement cascades. 1,500 tilted columns and the architectural mantra that finally stopped it.
Chapter 13 Canonical records — ten code paths can create the same kind of object. Each grew its own implicit schema. The audit, the four classes of asymmetry, and the canonical record that makes them agree.
Chapter 14 The no-trap principle — one missing UI row exposed a design rule: workflows guide, they don't gate. Plus the cascade of cross-coupled principles that surfaced in a single two-track design session.