Skip to content

Commit b82f552

Browse files
MorabbinCopilot
andauthored
Document Java memory section and add Copilot Memory links across SDK READMEs (#1783)
* Document memory configuration in Java SDK README Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix Java memory README example handlers and import Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add Copilot Memory docs links across SDK READMEs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a8255cb commit b82f552

6 files changed

Lines changed: 39 additions & 1 deletion

File tree

dotnet/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ When enabled, sessions emit compaction events:
419419
## Memory
420420

421421
Sessions can opt into persistent memory, allowing the agent to read and write memory across turns. Memory is configured per session and applies to both `CreateSessionAsync` and `ResumeSessionAsync`.
422+
For more background, see [About GitHub Copilot Memory](https://docs.github.com/en/copilot/concepts/agents/copilot-memory).
422423

423424
```csharp
424425
var session = await client.CreateSessionAsync(new SessionConfig

go/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ information across turns. Provide a `MemoryConfiguration` on session create or r
511511
when omitted, the runtime default applies. In the default `ModeCopilotCli` client mode the
512512
SDK leaves `Memory` unset so the runtime applies its own default, while `ModeEmpty`
513513
defaults `Memory` to disabled unless you set it explicitly.
514+
For more background, see [About GitHub Copilot Memory](https://docs.github.com/en/copilot/concepts/agents/copilot-memory).
514515

515516
```go
516517
// Enable memory for a session

java/README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,40 @@ Or run it directly from the repository:
132132
jbang https://github.com/github/copilot-sdk/blob/main/java/jbang-example.java
133133
```
134134

135+
## Memory
136+
137+
Sessions can opt into persistent memory, allowing the agent to read and write memory across turns. Memory is configured per session and applies to both `createSession` and `resumeSession`.
138+
For more background, see [About GitHub Copilot Memory](https://docs.github.com/en/copilot/concepts/agents/copilot-memory).
139+
140+
```java
141+
import com.github.copilot.rpc.MemoryConfiguration;
142+
import com.github.copilot.rpc.PermissionHandler;
143+
import com.github.copilot.rpc.ResumeSessionConfig;
144+
import com.github.copilot.rpc.SessionConfig;
145+
146+
// Enable memory for a new session
147+
var session = client.createSession(new SessionConfig()
148+
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
149+
.setModel("gpt-5")
150+
.setMemory(new MemoryConfiguration().setEnabled(true))
151+
).get();
152+
153+
// Disable memory for a new session
154+
var sessionNoMemory = client.createSession(new SessionConfig()
155+
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
156+
.setModel("gpt-5")
157+
.setMemory(new MemoryConfiguration().setEnabled(false))
158+
).get();
159+
160+
// Configure memory while resuming
161+
var resumed = client.resumeSession(sessionId, new ResumeSessionConfig()
162+
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
163+
.setMemory(new MemoryConfiguration().setEnabled(true))
164+
).get();
165+
```
166+
167+
When `memory` is left unset, no memory configuration is sent and the runtime default applies. In the default `CopilotClientMode.COPILOT_CLI` the SDK leaves `memory` unset so the runtime applies its own default, while `CopilotClientMode.EMPTY` defaults `memory` to disabled unless you set it explicitly.
168+
135169
## Using experimental APIs
136170

137171
Some SDK APIs are marked as experimental with `@CopilotExperimental`. These APIs may change or be removed in future versions without notice.
@@ -274,4 +308,3 @@ mvn jacoco:prepare-agent@wire-up-coverage-instrumentation antrun:run@print-test-
274308
## License
275309

276310
MIT — see [LICENSE](LICENSE) for details.
277-

nodejs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ information across turns. Provide a `memory` configuration on session create or
684684
when omitted, the runtime default applies. In the default `"copilot-cli"` client mode the
685685
SDK leaves `memory` unset so the runtime applies its own default, while `"empty"` mode
686686
defaults `memory` to disabled unless you set it explicitly.
687+
For more background, see [About GitHub Copilot Memory](https://docs.github.com/en/copilot/concepts/agents/copilot-memory).
687688

688689
```typescript
689690
// Enable memory for a session

python/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ When enabled, sessions emit compaction events:
505505
## Memory
506506

507507
Sessions can opt into persistent memory, allowing the agent to read and write memory across turns. Memory is configured per session and applies to both `create_session` and `resume_session`.
508+
For more background, see [About GitHub Copilot Memory](https://docs.github.com/en/copilot/concepts/agents/copilot-memory).
508509

509510
```python
510511
async with await client.create_session(

rust/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ The CLI emits `session.compaction_start` / `session.compaction_complete` events
574574
### Memory
575575

576576
Configure the runtime memory feature for a session:
577+
For more background, see [About GitHub Copilot Memory](https://docs.github.com/en/copilot/concepts/agents/copilot-memory).
577578

578579
```rust,ignore
579580
use github_copilot_sdk::types::{MemoryConfiguration, SessionConfig};

0 commit comments

Comments
 (0)