IamBishal

AI Engineering · Tutorial Series

Build a long-running support copilot

Keep an assistant sharp and affordable through a whole shift: a prompt laid out for the cache, tool results trimmed at the boundary, honest clearing, summaries and memory that don't fail silently, and numbers that tell you which policy to run.

By Bishal Saha · Updated

  • 3 Modules

    5 lessons live

  • Beginner

    Level

  • 2+ hours

    Learning Content

Start Learning

About This Tutorial Series

Keep an assistant sharp and affordable through a whole shift: a prompt laid out for the cache, tool results trimmed at the boundary, honest clearing, summaries and memory that don't fail silently, and numbers that tell you which policy to run.

What we build: A Helpline shift copilot: one conversation works through a queue of 24 synthetic Helpline tickets (a support rep's shift) under two standing instructions set at the start of the shift (no refunds on the Corvid Analytics account this week; tag every reply with the shift code). It reads tickets and knowledge-base articles through tools and drafts replies.

What You'll Learn

  • Break a long session into its parts (tools, system prompt, history, tool results) and read per-turn usage from a recorded shift. The reader can then say which failures to plan for: the bill, cache-bus
  • Order the copilot's prompt from stable to volatile, with deterministic tool definitions and a frozen system prompt, and turn on automatic caching. Check cache_read_input_tokens on later turns. Add ope
  • Trim ticket and knowledge-base tool results once, when they are added to history. Then clear old tool results, either server-side with clear_tool_uses or with client placeholders whose wording can't b
  • Keep a running summary with the standing instructions pinned word for word. Use threshold and on-demand compaction (beta) and pass the compaction block back exactly. Store notes that outlast a shift w
  • Replay the 24-ticket shift under the raw, trim, clear, summary+pin and fresh policies. Compare window size, cost per shift, cache-hit rate and standing-instruction retention, pick a policy, and protec

Prerequisites

  • Before you start

    Python. The Helpline tutorials help but are not required.

Course Curriculum

  1. What a long session sends on every request, what it costs, and how to lay the prompt out so the cache carries the shift.

Reviews (0)

No reviews yet

Finish a lesson and be the first to share what you thought.

View All Tutorials

Bishal SahaLet's build together

Have a system to design, or an AI feature to get right?

Tell me about the problem. You'll get a clear, honest view of the best way forward.

  • Reply within 24 hoursOn business days, with my honest view and a next step.
  • Accepting select engagementsArchitecture, AI features and full builds.
  • Remote, worldwideWorking with startups, SMEs and enterprises.