diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index f41592696..6c92ec926 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "7611d41136a1fe1a65083b13bc47c6909640737e", - "syncedAt": "2026-04-15T09:19:09.955Z" + "sha": "88d3620a85bff82a905dbb6ccdfd16c5ac5cf447", + "syncedAt": "2026-04-15T09:40:15.103Z" } diff --git a/docs/concepts/memory-search.md b/docs/concepts/memory-search.md index 944c006e1..ff444e6cb 100644 --- a/docs/concepts/memory-search.md +++ b/docs/concepts/memory-search.md @@ -15,8 +15,9 @@ chunks and searching them using embeddings, keywords, or both. ## Quick start -If you have an OpenAI, Gemini, Voyage, or Mistral API key configured, memory -search works automatically. To set a provider explicitly: +If you have a GitHub Copilot subscription, OpenAI, Gemini, Voyage, or Mistral +API key configured, memory search works automatically. To set a provider +explicitly: ```json5 { @@ -35,15 +36,16 @@ node-llama-cpp). ## Supported providers -| Provider | ID | Needs API key | Notes | -| -------- | --------- | ------------- | ---------------------------------------------------- | -| OpenAI | `openai` | Yes | Auto-detected, fast | -| Gemini | `gemini` | Yes | Supports image/audio indexing | -| Voyage | `voyage` | Yes | Auto-detected | -| Mistral | `mistral` | Yes | Auto-detected | -| Bedrock | `bedrock` | No | Auto-detected when the AWS credential chain resolves | -| Ollama | `ollama` | No | Local, must set explicitly | -| Local | `local` | No | GGUF model, ~0.6 GB download | +| Provider | ID | Needs API key | Notes | +| -------------- | ---------------- | ------------- | ---------------------------------------------------- | +| Bedrock | `bedrock` | No | Auto-detected when the AWS credential chain resolves | +| Gemini | `gemini` | Yes | Supports image/audio indexing | +| GitHub Copilot | `github-copilot` | No | Auto-detected, uses Copilot subscription | +| Local | `local` | No | GGUF model, ~0.6 GB download | +| Mistral | `mistral` | Yes | Auto-detected | +| Ollama | `ollama` | No | Local, must set explicitly | +| OpenAI | `openai` | Yes | Auto-detected, fast | +| Voyage | `voyage` | Yes | Auto-detected | ## How search works diff --git a/docs/providers/github-copilot.md b/docs/providers/github-copilot.md index 81d30ebe7..bc8656a76 100644 --- a/docs/providers/github-copilot.md +++ b/docs/providers/github-copilot.md @@ -119,6 +119,46 @@ Requires an interactive TTY. Run the login command directly in a terminal, not inside a headless script or CI job. +## Memory search embeddings + +GitHub Copilot can also serve as an embedding provider for +[memory search](/concepts/memory-search). If you have a Copilot subscription and +have logged in, OpenClaw can use it for embeddings without a separate API key. + +### Auto-detection + +When `memorySearch.provider` is `"auto"` (the default), GitHub Copilot is tried +at priority 15 -- after local embeddings but before OpenAI and other paid +providers. If a GitHub token is available, OpenClaw discovers available +embedding models from the Copilot API and picks the best one automatically. + +### Explicit config + +```json5 +{ + agents: { + defaults: { + memorySearch: { + provider: "github-copilot", + // Optional: override the auto-discovered model + model: "text-embedding-3-small", + }, + }, + }, +} +``` + +### How it works + +1. OpenClaw resolves your GitHub token (from env vars or auth profile). +2. Exchanges it for a short-lived Copilot API token. +3. Queries the Copilot `/models` endpoint to discover available embedding models. +4. Picks the best model (prefers `text-embedding-3-small`). +5. Sends embedding requests to the Copilot `/embeddings` endpoint. + +Model availability depends on your GitHub plan. If no embedding models are +available, OpenClaw skips Copilot and tries the next provider. + ## Related diff --git a/docs/reference/memory-config.md b/docs/reference/memory-config.md index d7e47bfb8..2cae17b9e 100644 --- a/docs/reference/memory-config.md +++ b/docs/reference/memory-config.md @@ -37,23 +37,24 @@ plugin-owned config, transcript persistence, and safe rollout pattern. ## Provider selection -| Key | Type | Default | Description | -| ---------- | --------- | ---------------- | ------------------------------------------------------------------------------------------- | -| `provider` | `string` | auto-detected | Embedding adapter ID: `openai`, `gemini`, `voyage`, `mistral`, `bedrock`, `ollama`, `local` | -| `model` | `string` | provider default | Embedding model name | -| `fallback` | `string` | `"none"` | Fallback adapter ID when the primary fails | -| `enabled` | `boolean` | `true` | Enable or disable memory search | +| Key | Type | Default | Description | +| ---------- | --------- | ---------------- | ------------------------------------------------------------------------------------------------------------- | +| `provider` | `string` | auto-detected | Embedding adapter ID: `bedrock`, `gemini`, `github-copilot`, `local`, `mistral`, `ollama`, `openai`, `voyage` | +| `model` | `string` | provider default | Embedding model name | +| `fallback` | `string` | `"none"` | Fallback adapter ID when the primary fails | +| `enabled` | `boolean` | `true` | Enable or disable memory search | ### Auto-detection order When `provider` is not set, OpenClaw selects the first available: 1. `local` -- if `memorySearch.local.modelPath` is configured and the file exists. -2. `openai` -- if an OpenAI key can be resolved. -3. `gemini` -- if a Gemini key can be resolved. -4. `voyage` -- if a Voyage key can be resolved. -5. `mistral` -- if a Mistral key can be resolved. -6. `bedrock` -- if the AWS SDK credential chain resolves (instance role, access keys, profile, SSO, web identity, or shared config). +2. `github-copilot` -- if a GitHub Copilot token can be resolved (env var or auth profile). +3. `openai` -- if an OpenAI key can be resolved. +4. `gemini` -- if a Gemini key can be resolved. +5. `voyage` -- if a Voyage key can be resolved. +6. `mistral` -- if a Mistral key can be resolved. +7. `bedrock` -- if the AWS SDK credential chain resolves (instance role, access keys, profile, SSO, web identity, or shared config). `ollama` is supported but not auto-detected (set it explicitly). @@ -62,14 +63,15 @@ When `provider` is not set, OpenClaw selects the first available: Remote embeddings require an API key. Bedrock uses the AWS SDK default credential chain instead (instance roles, SSO, access keys). -| Provider | Env var | Config key | -| -------- | ------------------------------ | --------------------------------- | -| OpenAI | `OPENAI_API_KEY` | `models.providers.openai.apiKey` | -| Gemini | `GEMINI_API_KEY` | `models.providers.google.apiKey` | -| Voyage | `VOYAGE_API_KEY` | `models.providers.voyage.apiKey` | -| Mistral | `MISTRAL_API_KEY` | `models.providers.mistral.apiKey` | -| Bedrock | AWS credential chain | No API key needed | -| Ollama | `OLLAMA_API_KEY` (placeholder) | -- | +| Provider | Env var | Config key | +| -------------- | -------------------------------------------------- | --------------------------------- | +| Bedrock | AWS credential chain | No API key needed | +| Gemini | `GEMINI_API_KEY` | `models.providers.google.apiKey` | +| GitHub Copilot | `COPILOT_GITHUB_TOKEN`, `GH_TOKEN`, `GITHUB_TOKEN` | Auth profile via device login | +| Mistral | `MISTRAL_API_KEY` | `models.providers.mistral.apiKey` | +| Ollama | `OLLAMA_API_KEY` (placeholder) | -- | +| OpenAI | `OPENAI_API_KEY` | `models.providers.openai.apiKey` | +| Voyage | `VOYAGE_API_KEY` | `models.providers.voyage.apiKey` | Codex OAuth covers chat/completions only and does not satisfy embedding requests.