Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ When enabled, sessions emit compaction events:
## Memory

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`.
For more background, see [About GitHub Copilot Memory](https://docs.github.com/en/copilot/concepts/agents/copilot-memory).

```csharp
var session = await client.CreateSessionAsync(new SessionConfig
Expand Down
1 change: 1 addition & 0 deletions go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ information across turns. Provide a `MemoryConfiguration` on session create or r
when omitted, the runtime default applies. In the default `ModeCopilotCli` client mode the
SDK leaves `Memory` unset so the runtime applies its own default, while `ModeEmpty`
defaults `Memory` to disabled unless you set it explicitly.
For more background, see [About GitHub Copilot Memory](https://docs.github.com/en/copilot/concepts/agents/copilot-memory).

```go
// Enable memory for a session
Expand Down
35 changes: 34 additions & 1 deletion java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,40 @@ Or run it directly from the repository:
jbang https://github.com/github/copilot-sdk/blob/main/java/jbang-example.java
```

## Memory

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`.
For more background, see [About GitHub Copilot Memory](https://docs.github.com/en/copilot/concepts/agents/copilot-memory).

```java
import com.github.copilot.rpc.MemoryConfiguration;
import com.github.copilot.rpc.PermissionHandler;
import com.github.copilot.rpc.ResumeSessionConfig;
import com.github.copilot.rpc.SessionConfig;

// Enable memory for a new session
var session = client.createSession(new SessionConfig()
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
.setModel("gpt-5")
.setMemory(new MemoryConfiguration().setEnabled(true))
).get();

// Disable memory for a new session
var sessionNoMemory = client.createSession(new SessionConfig()
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
.setModel("gpt-5")
.setMemory(new MemoryConfiguration().setEnabled(false))
).get();

// Configure memory while resuming
var resumed = client.resumeSession(sessionId, new ResumeSessionConfig()
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
.setMemory(new MemoryConfiguration().setEnabled(true))
).get();
```

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.

## Using experimental APIs

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

MIT — see [LICENSE](LICENSE) for details.

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

```typescript
// Enable memory for a session
Expand Down
1 change: 1 addition & 0 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ When enabled, sessions emit compaction events:
## Memory

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`.
For more background, see [About GitHub Copilot Memory](https://docs.github.com/en/copilot/concepts/agents/copilot-memory).

```python
async with await client.create_session(
Expand Down
1 change: 1 addition & 0 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ The CLI emits `session.compaction_start` / `session.compaction_complete` events
### Memory

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

```rust,ignore
use github_copilot_sdk::types::{MemoryConfiguration, SessionConfig};
Expand Down
Loading