Skip to main content
ngram’s central object is the Entity. A model request is one operation in its life; it is not the owner of its identity or storage.

Ownership

One turn at a time

Inputs from connected surfaces reach Entity.perceive. The Entity serializes complete turns with a shared asynchronous lock, protecting history, body state, relationships, and conversation routing from overlapping changes. Cancellation and inference-pause controls bypass the normal model turn. That keeps the control path available while the Entity is busy. Pausing also gates the provider shared by background inference consumers. The lock is scoped to one running Entity process. It is not distributed coordination for independently launched workers sharing arbitrary files.

Durable state and live context

Live conversation history is assembled for inference and can be compacted. Durable state lives in databases, files, or a portable Entity container. Retrieval chooses which durable material enters a turn; the model does not receive every stored memory each time. Start with cognition to follow a turn, memory to understand retention, and presence to understand surfaces and background work. Source entry point: ngram/entity.py.