> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# VS Code

> Give VS Code a citable project memory backed by your Cognee Cloud tenant.

The **Cognee — Project Memory** extension gives your editor a persistent, **citable** memory of the project. Remember and recall knowledge without leaving VS Code, and *ask your project memory* — get answers grounded in what Cognee knows about the current repository, with links back to the exact source files.

It works against a local Cognee server or, as covered here, your **Cognee Cloud** tenant. The extension needs no environment variables — it's configured entirely through VS Code settings and secret storage.

## 1. Install the extension

Install **Cognee — Project Memory** (extension ID `cognee.cognee-vscode`) from the VS Code Marketplace — search for it in the Extensions view. If it isn't available in your Marketplace yet, install the bundled VSIX with **Install from VSIX…**, or the CLI:

```bash theme={null}
code --install-extension cognee-vscode-0.1.0.vsix
```

<Info>
  Requires VS Code `1.85.0` or newer.
</Info>

## 2. Connect to Cognee Cloud

Run **`Cognee: Set Up`** from the command palette (`Cmd/Ctrl + Shift + P`):

<Steps>
  <Step title="Enter your endpoint">
    Your Cloud tenant URL, e.g. `https://your-tenant.aws.cognee.ai`.
  </Step>

  <Step title="Enter your API key">
    A key from the [API Keys](/cognee-cloud/ui/api-keys) page. It's stored securely in the OS keychain (secret storage) — **not** in `settings.json`.
  </Step>

  <Step title="Health check">
    The command runs a health check so you know the connection works before you start.
  </Step>
</Steps>

## 3. Use it

<Steps>
  <Step title="Remember">
    Open a file, select some code, and run **`Cognee: Remember Selection`**.
  </Step>

  <Step title="Ask">
    Run **`Cognee: Ask My Project Memory`** and ask a question — the answer appears in a panel with ranked, clickable citations that open the exact source file.
  </Step>
</Steps>

### Commands

| Command                         | What it does                                              |
| ------------------------------- | --------------------------------------------------------- |
| `Cognee: Ask My Project Memory` | Open the panel and query the repo's memory with citations |
| `Cognee: Recall`                | One-off query from the palette                            |
| `Cognee: Remember Selection`    | Store the current selection (or the whole file)           |
| `Cognee: Remember File`         | Store a file (also on the explorer context menu)          |
| `Cognee: Remember Note`         | Store a free-form note typed into an input box            |
| `Cognee: Index Workspace`       | Bulk-ingest eligible files after a preflight confirmation |
| `Cognee: Forget Project Memory` | Clear the graph (keep files) or delete the dataset        |
| `Cognee: Set Up`                | Configure endpoint + key and run a health check           |

## Per-repository datasets

Each repository maps to a **stable `vscode_<hash>` dataset**, derived from the git remote (or the workspace path as a fallback), so memory stays isolated per project. Set `cognee.datasetOverride` to pin a fixed dataset name instead.

## Settings

| Setting                             | Default                 | Description                                                                                                                                              |
| ----------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cognee.endpoint`                   | `http://localhost:8011` | Cognee backend base URL (set to your tenant URL for Cloud)                                                                                               |
| `cognee.apiKey`                     | `""`                    | API key, sent as the `X-Api-Key` header. Prefer `Cognee: Set Up`, which uses secret storage                                                              |
| `cognee.datasetOverride`            | `""`                    | Fixed dataset name; empty derives `vscode_<hash>` per repo                                                                                               |
| `cognee.searchType`                 | `auto`                  | Recall strategy; `auto` lets Cognee route the query, or force one of `GRAPH_COMPLETION`, `GRAPH_COMPLETION_COT`, `RAG_COMPLETION`, `CHUNKS`, `SUMMARIES` |
| `cognee.topK`                       | `15`                    | Max recall results                                                                                                                                       |
| `cognee.includeReferences`          | `true`                  | Attach source citations to answers                                                                                                                       |
| `cognee.ingestion.respectGitignore` | `true`                  | Skip `.gitignore`/`.cogneeignore` files when indexing (dependency/build dirs always skipped)                                                             |
| `cognee.ingestion.maxFileSizeKb`    | `512`                   | Skip files larger than this when indexing                                                                                                                |
| `cognee.requestTimeoutMs`           | `300000`                | HTTP request timeout                                                                                                                                     |

## How it works

The extension talks to Cognee over the HTTP API: **Ask / Recall** → `POST /api/v1/recall` (with `include_references: true`, scoped to the workspace dataset); **Remember / Index** → `POST /api/v1/remember` (ingest + graph build in one call); **Forget** → `POST /api/v1/forget`. Everything it ingests carries a `Source: <path>` header, so a citation resolves straight to the exact file — even when several files share a name.

<Note>
  Prefer GitHub Copilot's agent mode instead of the extension? VS Code can also use Cognee as an **MCP tool provider** via `.vscode/mcp.json` — see [Claude Desktop](/cognee-cloud/agent-integrations/claude-desktop) for the shared Cloud MCP config and [Cloud MCP](/cognee-cloud/connections/cloud-mcp) for the details.
</Note>

***

<CardGroup cols={2}>
  <Card title="GitHub Repository" icon="github" href="https://github.com/topoteretes/cognee-integrations/tree/main/integrations/vscode">
    Source, settings, and development guide
  </Card>

  <Card title="Cursor" icon="code" href="/cognee-cloud/agent-integrations/cursor">
    Connect the Cursor editor via MCP
  </Card>
</CardGroup>
