MockCertMockCert
Menu

Test yourself in exam conditions

A full GitHub Certified: Agentic AI Developer mock exam: 60 questions in 120 minutes, scored against the real exam's pass mark. Your first one is free.

Start a free mock exam
Domain 3 · 3 topics · about 20 minTopics in this domainTopics

Domain 3 · Overview

Overview

Up next: Implement agent memory strategies · 9 steps + check · 6 min

Domain 3 · Topic 1 of 3

Implement agent memory strategies

Step 1 of 9

Think first How do you decide what an agent should remember, for how long, and when to clear it?

Why it matters: Questions describe an agent's memory needs and ask which memory layer, scope, or expiry rule fits.

Agent memory works in layers. The conversation context holds the current task and lasts only for that session. Copilot Memory keeps lasting facts and preferences, which expire after a default period that restarts when Copilot upvotes them.

Step 2 of 9

Term Meaning
Conversation context What the current session already holds; a new session starts without it.
Repository-level fact A memory that describes a codebase and is shared with your collaborators.
User-level preference A memory about how you like to work that follows you from repository to repository.
Expiry period How long a memory lives; it starts at creation and restarts when Copilot upvotes it.
Subagent A helper agent with its own separate context window, focused on one assigned task.

Step 3 of 9

Copilot Memory has two scopes: the repository and the user. Repository facts describe the codebase for everyone working in it. User preferences describe your own habits. When you ask for a memory, state its scope plainly instead of relying on words like "always".

The two Copilot Memory scopes compared

Feature Repository-level fact User-level preference
Describes The codebase How you personally like to work
Who benefits Your collaborators in that repository You personally
Across repositories Not pooled across an organization, and not copied to a fork Follows you between repositories

Exam trap Scope does not depend on who stated the memory. Copilot picks repository or user scope based on who the memory applies to.

Step 4 of 9

Memory is for things that stay true over time. Copilot is told to skip short-lived or task-specific instructions. Use custom instructions for important rules, and let memory collect the growing detail that would bloat an instructions file. If a matching memory exists, Copilot can reinforce it rather than add a duplicate.

Exam trap Asking Copilot to remember something does not guarantee it is saved. The model weighs the prompt and the context before storing anything.

Step 5 of 9

Load only what the current task needs. A subagent works in its own context window, so its intermediate steps stay out of the main conversation. Agent skills load a workflow's resources only when the agent works on that task. In Copilot CLI, subagents with read_memories access can read memories. Only the root agent can store or vote on them.

Step 6 of 9

Copilot CLI can ask you to approve a memory update. You can approve one update, reject it with optional feedback, or allow future updates for the current repository, directory, or session. Any memory containing a secret, such as a token or key, is rejected. On GitHub.com you cannot edit a single memory in settings; you ask Copilot to add it.

Step 7 of 9

Turning memory off does not clear the current context. It stops new storage and retrieval, but memories already given to the conversation can stay. Start a new session to drop them. In non-interactive runs, memory is off by default, even when it is on for interactive sessions.

Example: Runs a single non-interactive prompt with Copilot Memory turned on for that run.

copilot -p "YOUR PROMPT" --enable-memory
  • --enable-memory: enables memory for this run only

Step 8 of 9

Copilot CLI can load memories from a JSONL file. Each line holds one versioned memory object. Required fields are type, version, scope, subject, fact, reason, and citations; externalId is optional. Running the import counts as approval, but secret scanning still applies. A conflict errors by default, unless you add --on-conflict skip.

Exam trap Rerunning the whole import after a partial failure can create duplicates. Resubmit only the records that failed.

Step 9 of 9

  • Memory should hold facts that stay true over time, not short-lived or task-specific instructions.
  • Repository facts are shared with collaborators; user preferences follow you between repositories.
  • Default expiry is 90 days; owners can choose 7 to 180 days, and the lower setting wins.
  • To drop memories already in context, turn memory off and start a new session.

Sources: Managing Copilot Memory for your personal account - GitHub Docs (opens in a new tab) · About GitHub Copilot Memory - GitHub Docs (opens in a new tab) · Custom agents - GitHub Docs (opens in a new tab) · Manually creating memories for GitHub Copilot - GitHub Docs (opens in a new tab) · Agent skills - GitHub Docs (opens in a new tab)

Check

Check: Implement agent memory strategies

Cards to recall, then questions on this topic. About 2 minutes. Nothing is saved without an account.

Loading the cards and questions…

Up next: Persist agent state and manage context drift · 11 steps + check · 7 min

Domain 3 · Topic 2 of 3

Persist agent state and manage context drift

Step 1 of 11

Think first How do you keep a long-running agent on track and pick up its work later without losing earlier decisions?

Why it matters: Questions describe a long or resumed agent task and ask how to save its state, resume it, or spot and fix drift.

Long sessions outgrow the context window, so Copilot compacts old history into a summary that keeps decisions and next steps. Checkpoints save those summaries, and workflow artifacts keep job data after the job ends. When the agent drifts, you can steer it mid-run.

Step 2 of 11

Term Meaning
Compaction Replacing old conversation history with a structured summary plus the original instructions and plan state.
Checkpoint A saved compaction summary; in Copilot CLI, a numbered file with a title.
Workflow artifact Data a job saves so it persists after the job ends and another job in the workflow can use it.
Steering Giving a running agent new input mid-session without stopping the run.
Cloud sandbox session A Copilot session whose files and in-progress work live in GitHub-hosted infrastructure, not on your device.

Step 3 of 11

Compaction swaps old history for a structured summary. The summary is kept with the user's original instructions and the latest state of any plans or to-do lists. With it, Copilot still knows what was discussed, what was decided and what comes next, even though the original messages are gone.

Step 4 of 11

Copilot CLI compacts in the background at about 80% context use. That leaves about 20% of the window so tool calls keep running. If usage reaches about 95% first, the CLI pauses briefly until compaction finishes. You can also run /compact at any time in Copilot CLI and the GitHub Copilot app. Xcode does not support compaction.

Exam trap Wrong: compaction waits until the context window is full. In Copilot CLI it starts automatically at about 80%, keeping a buffer for tool calls.

Step 5 of 11

A checkpoint is a saved compaction summary you can inspect. In Copilot CLI, checkpoints are numbered files with titles. If Copilot seems to forget a decision or contradicts earlier work, open the checkpoints. They show what compaction kept and what it may have summarized differently than you expected.

Exam trap Wrong: a compaction summary keeps every detail. Exact message wording, full command output and minor decisions from early in a long conversation may be left out.

Step 6 of 11

A rationale and confidence level turn an agent decision into a record. In GitHub Agentic Workflows, set issue-intent: true on an agent output to require both for that output. If the agent leaves them out, the workflow fails. An automation's agent adds both on its own whenever it changes a supported issue attribute.

Step 7 of 11

Artifacts keep job data after the job completes. Another job in the same workflow can then use that data. Name each artifact; otherwise it gets the default name artifact. On download, download-artifact checks the artifact digest against the upload step's output. A custom retention-days value cannot exceed the repository, organization or enterprise limit.

Exam trap Wrong: overwrite an artifact by re-uploading under the same name. Artifacts are immutable in upload-artifact v4, so an updated file needs a different artifact name.

Step 8 of 11

Resume a session to continue with its existing context. This avoids starting over. In Copilot CLI, use the Sessions tab or type /resume; cloud sessions appear next to local ones. Cloud sandbox sessions are not tied to the device that started them. Resuming one in the CLI brings back its full history and work.

Exam trap Wrong: session querying always works. Session data syncs by default, but with "remoteExport": false set in CLI settings, session querying is not available.

Step 9 of 11

Watch the live session log and steer as soon as the agent drifts. From the Agents tab, open any agent session to follow its progress and thought process in real time. If the request was scoped wrong, send steering input without stopping the run. Each steering message consumes AI credits.

Step 10 of 11

Pick how much context to keep: all, some or none. Resume keeps everything. Clearing context keeps the session but drops the conversation. A fresh session suits work that went the wrong way.

Ways to continue or reset an agent's context

Option What it keeps Best when
Resume a session The existing conversation context You want to continue without starting over
Clear context Session identity, system and developer messages, configuration, event log You want the same session without the model-facing conversation
Start a fresh session Nothing from the earlier conversation Work went wrong and you want a clean slate, not reconciled decisions

Exam trap Wrong: turning off Copilot Memory clears it from the current chat. Memories already supplied can stay in context, so start a new session to work without them.

Step 11 of 11

  • Compaction keeps a summary, the original instructions and plan state, but minor early decisions can be lost.
  • If Copilot contradicts earlier work, check the checkpoints to see what compaction kept.
  • Artifacts are immutable in upload-artifact v4, so upload a changed file under a new name.
  • Resume a session to keep its context; start fresh when the work went the wrong way.
  • Steer a running agent without stopping it; each steering message consumes AI credits.

Sources: Managing context for GitHub Copilot - GitHub Docs (opens in a new tab) · Workflow artifacts - GitHub Docs (opens in a new tab) · Agent management - GitHub Docs (opens in a new tab) · Managing agent sessions - GitHub Docs (opens in a new tab) · Managing rationale, confidence, and approvals for issues - GitHub Docs (opens in a new tab) · Store and share data with workflow artifacts - GitHub Docs (opens in a new tab) · Context clearing and terminal tools - GitHub Docs (opens in a new tab) · Managing Copilot Memory for your personal account - GitHub Docs (opens in a new tab)

Check

Check: Persist agent state and manage context drift

Cards to recall, then questions on this topic. About 2 minutes. Nothing is saved without an account.

Loading the cards and questions…

Up next: Ensure continuity of agent memory and state across tools and environments · 11 steps + check · 6 min

Domain 3 · Topic 3 of 3

Ensure continuity of agent memory and state across tools and environments

Step 1 of 11

Think first How do you keep an agent's memory shared, consistent and current as work moves between tools and sessions?

Why it matters: Questions describe agents sharing memory or context and ask how to share state, avoid conflicts or avoid stale facts.

Copilot Memory keeps facts that stay true over time and shares them across Copilot surfaces. Scope and precedence rules keep context from conflicting. Citation checks, votes and expiry keep it from going stale.

Step 2 of 11

Term Meaning
Repository-level fact A memory that describes a codebase and is shared with your collaborators on it.
User-level preference A memory that applies to you and follows you from one repository to another.
Expiry period How long a memory lives: 90 days by default, reset when Copilot upvotes it.
Compaction Copilot replacing old conversation history with a summary to free room in the context window.
Checkpoint What you check when Copilot seems to forget a decision, to see what compaction preserved and what it summarized differently.

Step 3 of 11

A memory captured on one Copilot surface serves the others. If Copilot cloud agent works out your repository's approach to database connections, Copilot code review can apply it later. Repository facts are shared with your collaborators. They are not pooled across an organization's repositories, though.

Exam trap Forking a repository does not bring its memories along. The fork starts without the original's stored repository facts.

Step 4 of 11

Scope follows who a memory applies to, not who said it. Words like "always" or "going forward" do not set scope, so say it explicitly. When your intent is unclear, Copilot asks you to clarify rather than guess.

Repository facts and user preferences compared

Feature Repository-level fact User-level preference
Applies to Everyone working in the repository You, across repositories
Delete it immediately in Repository settings Personal settings

Step 5 of 11

In Copilot CLI, only the root agent writes memories. Only the root agent can call store_memory or vote_memory. Subagents with read_memories access can read memories but never change them. Subagents also get their own context windows, which keeps the main agent's context focused.

Step 6 of 11

Precedence decides which instructions win. For Copilot Chat on GitHub.com, personal instructions rank highest and organization custom instructions lowest. Path-specific instruction files outrank .github/copilot-instructions.md, which outranks AGENTS.md. In pull request review, Copilot reads instructions and skills from the head branch, not the base branch.

Exam trap Asking Copilot to store a memory does not guarantee it is stored or always used. Put rules that must apply every time in custom instructions.

Step 7 of 11

Copilot checks a fact's citations against the current branch. That check tells Copilot whether a repository fact is still accurate before it relies on it. It upvotes facts it can validate and downvotes wrong or outdated ones. Copilot is instructed not to store short-lived, task-specific instructions. When a matching memory exists, Copilot can reinforce it instead of adding a duplicate.

Step 8 of 11

Memories expire after 90 days by default. Owners can set repository-fact expiry anywhere from 7 to 180 days. If an organization and its enterprise set different values, the lower one applies. An upvote resets the period, but simply retrieving a memory does not.

Exam trap Telling Copilot to "forget" a memory only downvotes it. To delete it right away, use your personal or repository settings.

Step 9 of 11

Compaction summarizes old history to free the context window. Copilot CLI starts compacting in the background at about 80% of the window. The summary keeps your original instructions and current plans, but fine detail can be lost. A finished compaction cannot be undone. If Copilot contradicts earlier work, check its checkpoints to see what compaction preserved.

Step 10 of 11

A new session clears old context. Start fresh when work went in a wrong direction, so Copilot stops reconciling old decisions with the new approach. Turning off memory in Copilot CLI stops storage and retrieval. Memories already loaded stay in the current conversation until you start a new session.

Step 11 of 11

  • Repository facts are shared with collaborators, but not across repositories or into forks.
  • Only the root agent in Copilot CLI can store or vote on memories.
  • Memories expire after 90 days by default; upvotes reset the clock, reads do not.
  • In non-interactive runs such as copilot -p, memory is off unless you add --enable-memory.
  • Use custom instructions, not memory, for rules that must always apply.

Sources: About GitHub Copilot Memory - GitHub Docs (opens in a new tab) · Manually creating memories for GitHub Copilot - GitHub Docs (opens in a new tab) · Custom instructions for GitHub Copilot - GitHub Docs (opens in a new tab) · Managing context for GitHub Copilot - GitHub Docs (opens in a new tab) · Managing Copilot Memory for your personal account - GitHub Docs (opens in a new tab)

Check

Check: Ensure continuity of agent memory and state across tools and environments

Cards to recall, then questions on this topic. About 2 minutes. Nothing is saved without an account.

Loading the cards and questions…

Domain 3 · after the last topic

Domain 3 review

Each topic's Check tested it on its own; this mixes them.

Mixed quiz

Take the Domain 3 quiz

8 questions mixed from every topic in this domain, each answer explained. Mixing topics is harder than one at a time, and it is what the exam does. No account needed; with a free account your answers also build your estimated exam score.

Flashcards

Domain 3 flashcards

6 cards with this domain's key facts. Flip each one and check what you knew. No account needed.

Test yourself in exam conditions

A full GitHub Certified: Agentic AI Developer mock exam: 60 questions in 120 minutes, scored against the real exam's pass mark. Your first one is free.

Start a free mock exam
Next domain · 15–20% of the examPerform evaluation, error analysis, and tuning3 topics

Report a problem

On “”. Tell us what looks wrong; we read every report.

What is the problem?

Optional.