EACI Development Journal · Memory & Context

How Do You Slice AI Context Without Losing Memory?

The live turn uses a short recent window while durable memory and topic retrieval supply older context. The split keeps prompts bounded without making every chat feel new.

Memory & Context ~9 min issue-tagged
Issue this fixes

Sending an entire conversation on every turn eventually slows requests, raises cost, and crowds out the instructions that define a companion. Sending only the latest message is fast but loses continuity.

The current request builder takes the last 14 history items, then adds compact local memory and relevant topic context through separate paths. Recency and long-term recall are therefore allowed to solve different jobs.

What was actually going wrong

A single unbounded history array was being asked to provide both immediate conversational flow and durable identity continuity.

What I tried

What finally worked

A `slice(-14)` recent window is combined with filtered local memory, topic context, and the active companion prompt.

Why it worked

Recent wording stays intact while older material competes for inclusion by relevance instead of age alone.

What I learned

Context windows work best as layers, not one ever-growing transcript.

Where EACI uses this today

Caelum, Chad, Natalia, Atreus, Luna, Roxy, and Cael receive bounded recent context plus their permitted memory layers.

This journal covers real engineering on EACI Companion / The Veil. Companions include Caelum, Chad, Natalia, Atreus, Luna, Roxy, and Cael. Journal articles stay family-safe in content. See Privacy and Ethics.