Using CoreTex In An Agent

The agent lifecycle has four moments: before a model call, fetch cited context with prefetch and inject it; after the call, feed the raw turn into sync_turn; at session end, call flush_session; and periodically, synchronize to the newest accepted release.

Python applications use the adapter classes or AgentMemory directly. Applications in other languages can use the localhost sidecar. Keep unrelated users in separate scopes and always inject the exact rendered context the system returns.