Inspiration

People increasingly use several AI tools in the same day: Codex for engineering, another model for research, and another agent for writing, planning, or operations. Each tool may be capable, but each starts from a different history. Users repeat the same goals, preferences, decisions, and constraints, while old summaries can quietly remain in prompts after they are no longer true.

We did not want to build another chat interface. We wanted to solve the infrastructure problem underneath it: how can different AI agents share one governed, up-to-date understanding of the same user without replaying the entire conversation history?

That became Shiliu, a model-independent long-term context layer for AI applications.

What it does

Shiliu sits between an application and its model call. Before an agent responds, the application asks Shiliu for the context that is relevant, current, and permitted for this task. After the task is complete, the application can asynchronously send the turn and tool events back to Shiliu.

Shiliu does not simply append more text to a vector database. It produces an Effective Memory View that resolves stable facts, temporary state, corrections, suppression, forgetting, scope, and newer evidence before context is returned. A Change Trace records when an older understanding has been replaced, so stale conclusions do not remain equally authoritative forever.

The result is compact, evidence-aware context that can be reused across sessions, clients, models, and agents. Shiliu returns context rather than the final chatbot reply, so the host agent keeps control of reasoning, personality, and expression.

Demo

The demo shows a synthetic user moving between two agents.

Agent A, running through a Codex client, writes a stable preference: the user prefers osmanthus oolong tea. The completed turn is sent to Shiliu with a trace ID and idempotency key, and the response confirms whether the information was persisted, kept transient, suppressed, or rejected.

Agent B then asks a natural question for the same external user identity. Without receiving the original conversation, it retrieves the current preference through Shiliu together with the evidence and policy diagnostics that explain why the memory was selected.

The demo also shows a changing-state example. An older statement says the user does not want to manage anyone. Newer evidence says the user will lead a three-person pilot while protecting a design boundary. Shiliu does not return both statements as equally valid. The Effective Memory View suppresses the stale conclusion and serves the newer, bounded state.

How we built it

Shiliu exposes explicit, model-neutral API boundaries:

  • POST /v1/turns/ingest processes a completed conversation turn.
  • POST /v1/memory/recall retrieves governed memory and diagnostics.
  • POST /v1/chat/context creates a neutral context capsule for an agent.

The service is built around a MemoryService core, Effective Memory View policy ordering, multiple recall lanes, Change Trace, evidence anchors, identity and scope resolution, and persistence adapters. Tenant, user, application, agent, persona, and visibility scope are kept separate. Local development uses SQLite, while the production path supports PostgreSQL.

Customer-private data is not used for model training by default. Writes use trace IDs and idempotency controls, and clients receive explicit memory outcomes instead of treating an HTTP success response as proof that durable memory was created.

How we used Codex and GPT-5.6

Codex was our primary engineering environment during Build Week. We used it to inspect the repository, trace the existing memory pipeline, refine API contracts, review implementation boundaries, generate regression cases, debug persistence and scope failures, prepare the public demo package, and produce the submission documentation.

GPT-5.6 helped us reason across the full memory lifecycle rather than isolated functions. It identified failure modes such as stale-state contamination, cross-agent persona leakage, ambiguous write outcomes, and context returned without sufficient evidence. We converted those findings into repeatable tests and clearer API contracts. The submitting team confirms that the cited Codex sessions used GPT-5.6.

Challenges we ran into

The hardest problem was not storing text. It was deciding what should still influence the next task.

We had to distinguish HTTP success from confirmed persistence, stable facts from transient statements, current state from superseded state, shared user context from agent-private memory, and retrieval evidence from the final generated answer. We also had to keep the memory platform neutral so that one agent's personality would not leak into another agent.

These challenges pushed us toward explicit memory outcomes, deterministic policy ordering, evidence-aware diagnostics, no-answer behavior, and negative-path regression tests rather than one increasingly large prompt.

Accomplishments that we are proud of

  • A live product site and a model-independent API for ingestion, recall, context composition, governance, and diagnostics.
  • A reproducible public Build Week regression with 20 consecutive Codex A/B client-switching round trips, plus turn-persistence and persona-neutrality checks.
  • Broader private validation using a 100-turn Codex A/B cross-account memory corpus with six sampled cross-account recall probes.
  • A separate 120-turn real-model continuity simulation spanning one simulated year.
  • Public LongMemEval-CN evidence: a 499/500 first run on the published 500-question Chinese long-memory evaluation under the documented judge setup, with the remaining item documented and reviewed separately.
  • A no-training-by-default policy for customer-private data.

The 20-round public regression, the 100-turn cross-account corpus, the 120-turn long-horizon simulation, and the 500-question benchmark measure different things. We keep them separate rather than combining them into one inflated number.

What we learned

Long-term context is a state-management and governance problem, not merely a similarity-search problem. A useful memory layer must know what changed, what should no longer be used, what belongs to which scope, and why a particular item was selected.

We also learned that memory infrastructure should not impersonate the agent. When the memory layer remains neutral, the same governed context can support different products, models, workflows, and personalities without forcing them to share one voice.

What's next

Next we will package the API and SDK for faster partner integration, expand tenant administration and customer-controlled governance, add document- and image-derived memory with page-level evidence provenance, and continue regression work for temporal reasoning, updates, abstention, and long-running enterprise tasks.

Qiqi, the first user-facing agent built on Shiliu, will remain a real product proving ground for long-term continuity. Shiliu itself will continue to develop as the independent context infrastructure underneath many agents.

Public evidence and source boundary

The public evaluation repository contains benchmark data, evaluation methods, and reproducibility evidence. It is not the Shiliu production backend repository. The proprietary memory engine and production source code remain private; only a sanitized demo and integration surface are shared for this submission.

Built With

Share this project:

Updates