逐日AI

面试题库

共 328 题,当前筛选 1 题。

标签
还有 126 个标签
#agent-loop2#api-design2#chunking2#cost-tradeoff2#debugging2#distributed-systems2#error-handling2#hybrid-search2#llm-as-judge2#multi-agent2#multi-hop2#oauth2#operations2#pipeline-design2#prompt-caching2#rag2#recall2#retrospective2#retry2#scheduling2#sse2#tool-permissions2#trade-offs2#access-control1#agentic-rag1#agents-sdk1#analytics1#architecture-review1#behavioral1#budget-control1#caching1#cancellation1#checkpointing1#circuit-breaker1#citation-verification1#client1#client-integration1#coding-agent1#compaction1#compliance1#concurrency1#confused-deputy1#context-engineering1#contextual-retrieval1#copyright1#correctness1#cost-control1#customer-support1#data-quality1#database1#deployment1#distribution1#embedding-migration1#error-propagation1#escalation1#evidence1#faithfulness1#fallback1#feedback-loop1#fencing-token1#filter-pushdown1#filtering1#framework-design1#graph-rag1#guardrails1#handoff1#image-generation1#integration1#iterative-scan1#json-parsing1#labeling1#latency1#latency-budget1#least-privilege1#long-context1#long-session1#long-term-memory1#mcp1#message-bus1#methodology1#model-migration1#multi-tenancy1#notifications1#ocr1#offline-testing1#project-storytelling1#protocol-versions1#quality1#query-rewriting1#rate-limiting1#reconnect1#refusal1#replay1#reproducibility1#rerank1#resume1#retrieval1#risk-assessment1#rollout1#routing1#runtime1#safety1#scaling1#self-introduction1#split-brain1#state-management1#state-persistence1#statelessness1#stdio-transport1#storytelling1#subagent1#subagents1#subscriptions1#test-strategy1#thresholds1#timezone1#token-accounting1#tool-design1#tool-schema1#tools1#trust-boundary1#ux1#versioning1#workflow-design1#workflow-engine1#zero-downtime1

5 天上下文工程

D4 长时程会话:压缩、笔记与记忆文件、子代理隔离与交接摘要

  • 压缩最容易丢什么?你怎么验证一次压缩没有丢掉关键信息?What does compaction lose most easily, and how do you verify that a given compaction kept what mattered?
    国内高频海外高频深入#compaction#verification

    分析过程 · 先想清楚再作答

    1. 这题的区分度全在后半句。谈「要保留重要信息」是空话,面试官想听的是一个可执行的验证机制,以及你有没有真的被它拦下来过。
    2. 怎么拆:先说清压缩为什么比裁剪危险。裁剪动结构,删掉一个字段你知道删了什么、也能取回来;压缩动语言,丢掉了什么是模型决定的,而且丢完不留任何标识。
    3. 点出最脆弱的两类内容:一是最近几轮正在进行的事,一折叠就失去指代对象,模型下一句就会问你说的是哪一单;二是形式上不像结论的硬性要求,比如用户提出的时间点、情绪化诉求、口头承诺——它们在语言上不重要,在业务上是全部。还有一类是标识符,摘要很容易把订单号写成「相关订单」。
    4. 结论给验证机制:预置一组「压缩后必须还能找到」的关键事实,每次压完逐条核对,不通过就拒绝这次压缩或调大保留轮数。三条配套措施是:保留最近若干轮原文、在摘要提示词里让硬性要求单独成段、明确要求逐字保留标识符。
    5. 可预期的追问:你被这个检查拦下来过吗?给一个具体例子最有力,比如把保留轮数从 6 调到 1 时压缩率从 68% 涨到 87%,但「用户要求周五 18:00 前答复」这条直接消失——因为它只活在最近几轮原文里,而且它不像一条结论。

    How to reason about it · think before answering

    1. The signal is entirely in the second half. Saying you keep the important parts is empty; interviewers want an executable verification step and evidence it has actually caught something.
    2. Explain why compaction is riskier than trimming. Trimming changes structure: you know which field you removed and you can fetch it back. Compaction changes language: what got dropped is the model's choice, and nothing marks the loss.
    3. Name the fragile categories. First, whatever is currently in flight in the last few turns, which loses its referent the moment it is folded. Second, hard requirements that do not look like conclusions, such as user-stated deadlines, emotional demands, or verbal commitments. Third, identifiers, which summaries happily rewrite from an order number into the relevant order.
    4. Conclusion: preset a list of facts that must remain findable after compaction and check them every time, rejecting the compaction or widening the verbatim window on failure. Support it with three measures: keep recent turns verbatim, give hard requirements their own section in the summary prompt, and demand verbatim preservation of identifiers.
    5. Expect the follow-up asking whether it ever caught you. A concrete case lands best: dropping the verbatim window from six turns to one raised the compression ratio from 68 to 87 percent but silently deleted a user's stated Friday deadline, because it lived only in recent turns and did not read like a conclusion.

    答题要点

    • 压缩比裁剪危险:裁剪动结构可回溯,压缩动语言且丢失无标识。
    • 最容易丢的三类:最近几轮正在进行的事、不像结论的硬性要求、标识符。
    • 验证机制:预置一组必须存活的关键事实,每次压完逐条核对,不通过就不采纳这次压缩。
    • 配套三招:保留最近若干轮原文、硬性要求在摘要里单独成段、要求逐字保留标识符。

    Key points

    • Compaction is riskier than trimming: structure is recoverable, language loss is silent.
    • Three fragile categories: what is in flight in recent turns, hard requirements that do not look like conclusions, and identifiers.
    • Verification: preset facts that must survive and check each one after every compaction, rejecting it on failure.
    • Support with a verbatim recent window, a dedicated section for hard requirements, and explicit verbatim preservation of identifiers.