Skip to content

Define a shared session memory schema across specialist bots

Stop asking customers to repeat their email, order number, or goal every time a new specialist assistant joins the conversation.

Copy the prompt and paste it into the AI assistant you already use.

Steps to structure multi-agent session memory

  1. 01

    Separate verified facts from user assertions

    Store API-authenticated attributes like plan tier and account ID in read-only slots separate from conversational user preferences.

  2. 02

    Keep a rolling structured scratchpad

    Maintain concise JSON keys for current goal, resolved blockers, and open questions instead of re-feeding 40 raw chat turns.

  3. 03

    Define per-field write ownership

    Allow only designated agents or deterministic webhook tools to mutate sensitive state keys such as eligibility or booking status.

  4. 04

    Set TTL expiration on transient context

    Expire temporary troubleshooting symptoms after session closure while retaining opted-in workspace preferences safely.

How it works in practice

Current repetitive chat experience

User gives company size (120 seats) and stack (Okta + Snowflake) to Sales Bot, then Solutions Bot asks for team size and SSO provider all over again.

Shared session state payload

{"account_context": {"seats": 120, "sso": "Okta", "warehouse": "Snowflake", "source": "user_stated"}, "qualification_stage": "technical_fit", "open_questions": ["data_residency_region"]}

Injecting a compact 6-field JSON state lets the Solutions Bot open with 'Since you run Okta and Snowflake for 120 seats, let's check residency.'

Questions and answers

Why not pass the entire raw chat transcript to every specialist agent?

Long transcripts inflate token costs, slow down time-to-first-token, and distract downstream agents with outdated tangents from earlier topics.

How do we stop a confused agent from corrupting shared memory?

Validate every memory update against a strict JSON schema and restrict critical fields so only deterministic backend tool responses can write them.

Should customers be able to view or reset saved chatbot preferences?

Yes—providing a simple command or settings toggle to clear remembered preferences improves accuracy when user projects change and supports privacy trust.

Learn more

Related guides and background articles for this task