Agent Application DevelopmentAccount
Knowledge catalogChoose core direction and segmented content
knowledge unit 28AdvancedImplementationAbout 18 minutes

Understand → Implement → Debug → Design

Objects, sources, and bitemporal reasoning in memory conflicts

Examine fact versions, validity times, source priority, and conflict presentation.

memory conflictversionValid time

Knowledge content check2026-10-03 · Check the source of the original question2026-10-02

Which step do you want to learn from this knowledge point?

Select the starting point based on the current basis, or you can go deeper one by one. When you encounter an unfamiliar concept, go back to the core principles first; use the knowledge exercises to check your understanding when you are finished.

Understand first

New to this knowledge point

Complete the prerequisite concepts, read the principles and counterexamples, and then explain why in your own words.

Start with core principles →

Realize again

Prepare to write the principles into code

Understand implementation steps and boundaries, complete small tasks, and check results against acceptance requirements.

Reading implementation and trade-offs →

Will troubleshoot

Need to handle failures and changes in conditions

Follow the continuous questioning to locate the failure premise, and then compare the migration cases to explain how the plan should be adjusted.

Continue to delve deeper into the problem →

Able to choose

Need to design or review plans

Combine engineering deductions and senior self-evaluation standards to explain the applicable conditions, costs and alternatives of the plan.

Analyze engineering scenarios →
Knowledge unit directory

LEARN · PRACTICE · REFLECT

Knowledge learning and personal records

My notes and review ↗

First read along the principles, Q&A and migration cases. When you need to check your understanding, switch to reinforcement exercises or start personal recording.

Answers and personal notes

Each modified commit will be kept as an independent history. Your level of mastery is up to you to evaluate yourself against the standards.

Core concept · Objects, sources, and bitemporal reasoning in memory conflicts

Understand the core principles first

Preparatory concepts:fact objects and properties, Version and source, Business effective time

Two memories will conflict only if they have the same object, the same attributes, the same scope and overlapping validity time. The recording time cannot replace the business effective time, and similarity cannot determine the facts.

Check whether two facts actually conflict

“Project A uses Java” and “Project B uses Go” differ in scope. “Used Java last year” and “moved to Go today” differ in time. Selecting the newest or most similar record can discard those distinctions. Structure subject, attribute, scope, and validity, then compare applicable facts.

Distinguish observation time from effective time

Observation time records when the system learned a fact; effective time records when it applied. Importing old meeting notes today does not make them current configuration. Bitemporal modeling supports historical reality and historical knowledge queries. Its complexity is useful for late records, audits, or historical questions, but unnecessary for every preference.

Explain conflict resolution

Consider explicit corrections, authoritative sources, confirmation, and applicability rather than blindly choosing the latest entry. Users confirm personal preferences; trusted configuration defines organizational rules; tools may need fresh state queries. Equally credible conflicting facts remain pending confirmation with explicit differences. A compromise can invent a third unsourced fact.

Historical existence does not grant current access

Historical values can support past-state questions, but deletion and revocation change current access. Apply authorization and retention rules to old versions. Correcting memory does not undo actions already taken; reconciliation or compensation handles those effects. Overwriting history with new knowledge can erase the reason for an earlier decision.

Check understanding with a question

When two opposite facts appear in long-term memory, should you believe the latest one or the most similar one?

Recency or similarity alone cannot resolve facts. Compare subject, attribute, scope, and validity, then sources, explicit corrections, and confidence. Record observation and effective times separately. Preserve unresolved candidates for clarification instead of inventing a third unsupported conclusion.

Realization and trade-offs

Definition of conflict

"The user used to use Java" does not conflict with "now uses Go"; "this project uses PostgreSQL" has a different scope than "another project uses MySQL". First normalize by entity, attribute, project and valid time. Similarity can only help find relevant records, but cannot determine authenticity. Conditions and negations should also be retained during model extraction to avoid creating false conflicts.

Two timelines

observed_at represents the time when the system received the information, and valid_from and valid_to represent when the fact is valid. Late history should not overwrite the current state. Explicit user corrections take precedence over old inferences, but if organizational policy is involved, a distinction needs to be made between personal statements and authoritative institutional sources. Source priority is an application rule and should not be determined ad hoc for each model build.

Merging and concurrent writing

Establish a version number or conditional update for the same subject attribute to prevent two asynchronous writes from overwriting each other. Save the conflict relationship and supersedes reference, and construct the view according to the current task time and scope when reading. Important fields can suspend automatic application and require confirmation in case of conflict, such as invoice header or external contact person. You cannot randomly select a record that "seems more reasonable".

Verification time and source rules

Deliver old facts, new facts, error corrections and revocations in random order, and check that the final effective view is consistent. Then test historical queries, such as "Which database was used last month?" to ensure that the system does not project current values ​​into the past. Explain the processing boundary between retaining history and deletion requests: The traceability of history does not mean that the revoked content can continue to be read by the model.

Engineering deduction

scene
Interview hypothesis: An old project configuration was just imported today, as opposed to the new configuration confirmed last week.
design decisions
Record the validity time and source. Late and old records will not overwrite the current configuration.
Verify target
Current queries use the new configuration, and historical queries can be interpreted by time.
applicable boundary
Authoritative source priority rules need to be specified at the business layer.

Continuous questions and answers

Continue reading along with the premises and constraints of the problem. Understand the reference answers first, then try to put away the answers and explain the cause and effect and trade-offs in your own words.

Draw inferences from one example: If the conditions change, how to deduce it?

First find out the conditions for change, and then determine which premises in the original plan still hold true. The following cases are teaching deductions to facilitate the transfer of principles to new problems.

Re-record past configuration

Changing conditions:I just received last month’s change record today.

Extended question:When answering the project configuration last month, should I cache or make up for the record at that time?

Derivation and reference solutions

First confirm whether the user asked "the actual configuration last month" or "the configuration known by the system at that time". The former answers according to the valid history that has been verified so far, and the latter answers according to the recorded perspective at that time and explains the subsequent corrections. Without complete historical sources, uncertainty remains, and today's status cannot be used to extrapolate back to last month.

The principles that remain unchanged:Recording time and valid time correspond to different queries and cannot be interchanged.

The results of the two tools are opposite

Changing conditions:The sources are all credible, but the reading times are different.

Extended question:Can the newly read permission replace the approval in the old task?

Derivation and reference solutions

Current permissions determine continued access, but do not prove that old approvals override new actions. Check separately that permissions are now valid, approved objects and versions still match, and whether external objects have changed. Multiple facts cannot be mixed into one "latest state"; the corresponding action is suspended if any key conditions are missing.

The principles that remain unchanged:Each fact has its own object and valid scope, and trusted sources will not automatically establish cross-fact dependencies.

Easy to make mistakes

  • The highest similarity is the truth
  • Only one update time is saved
  • Discard sources and conditions when merging

References

It is designed based on public technical information; the reference materials support the technical mechanism, and the scenarios and scoring standards are designed by this website and do not represent the original interview questions of a certain company. New Q&A and migration cases are added for principle explanation, and source verification and case operation verification are recorded separately.

Check how far you understand

After reading, you can explain the principles, boundaries, and trade-offs against these standards. It is up to you to evaluate your mastery; if further verification is needed, complete the small tasks below.

Basic standards met
First assess conflicts by object, attribute, scope, and effective time.
Intermediate and advanced signals
Observation time and effective time can be modeled separately, and clear error correction relationships can be recorded.
Senior Signal
Test concurrency, history views, and undo boundaries with out-of-order events.

Continue to do advanced research experiments

Why can’t the old context continue to be used after the policy changes?

Transferring pre-retrieval filtered ideas to memory versions and recovery. Observe how existing drafts become invalid after cancellation.

Read full text and fault analysis → · Download Reliability Experiment v3 ↓

python3 cli.py memory-put --db memory.sqlite
python3 cli.py submit --db memory.sqlite
python3 cli.py run --db memory.sqlite --lease-seconds 2 --fault after_draft
python3 cli.py memory-forget --db memory.sqlite
# 等待至少 2 秒后分别执行
python3 cli.py run --db memory.sqlite
python3 cli.py inspect --db memory.sqlite

Keep evidence and check item by item

  • The draft checkpoint already exists after the first exit.
  • Recovery after memory-forget gets failed with memory_changed_or_expired.
  • No publish checkpoint; explain the difference between fail blocking and complete deletion.

Verify local scope, version, and undo blocking; old checkpoints remain, no complete deletion of logs, backups, or checkpoints is provided.

Hands-on verificationComplete on demand · Suggestions15 minutes

For three database configuration records arriving out of order, derive the current value and the previous month's value.

Expand acceptance requirements and checkpoints
  • Observation time does not pretend to be effective time
  • Don’t mix different projects
  • Preserve conflicts if they cannot be adjudicated

Key inspections

  • Determine whether there is a conflict based on scope
  • Distinguish between observation time and effective time
  • Concurrent updates and error correction traceable