# Find a past session

import { Steps, Aside } from '@astrojs/starlight/components';

Every prompt you send Docs Agent runs in a session. Search lets you find any session across your organization's whole history — including work you never turned into a pull request — and pick up where you left off.

You can find a session two ways:

- **Search by keyword** — match on what was said in the conversation.
- **Paste a link** — jump from a pull request, merge request, or ticket to the session behind it.

## Open search

<Steps>
1. Open the editor and expand the sessions sidebar.

2. Click the **Search sessions** field at the top of the sidebar.

3. Type your query. Results open in a focused view centered on the page.
</Steps>

The sidebar list stays as it is while you search — results appear in the focused view, not by filtering the list underneath. To close the view, press **Escape**, click outside it, or select a result. Your query stays in the search field so you can refine it.

## Search by keyword

Type at least two characters to search. Docs Agent matches your query against:

- The session title
- The title of the documentation pull request the session produced
- The conversation — both your messages and the agent's replies

Results are ranked best match first. Each result shows the session title and a snippet of the matching text, with the matched words highlighted. An attribution label tells you where the match came from:

| Label | Meaning |
|-------|---------|
| **you asked** | The match is in one of your messages. |
| **agent replied** | The match is in one of the agent's replies. |

Select a result to open that session in the editor.

<Aside type="tip">
Search tolerates small typos and matches partial phrases, so you don't need to remember the exact wording. Search a phrase you recall from the conversation to narrow a large history.
</Aside>

## Find a session from a link

Paste a URL into the search field to find the session it relates to. Docs Agent resolves these links:

| Paste this | Finds |
|------------|-------|
| A GitHub pull request URL | The session triggered by that pull request, or the session that produced it |
| A GitLab merge request URL | The session triggered by that merge request, or the session that produced it |
| A Jira ticket URL | The session linked to that ticket |
| An EkLine session URL | That session directly |

Link search matches exactly, so a single paste takes you to the related session or sessions. Docs Agent shows the matches and lets you choose one — it never opens a session on your behalf.

You can paste a messy URL. A link that points at a pull request's **Files** tab or a specific review comment still resolves. Self-managed hosts such as GitHub Enterprise and self-hosted GitLab work the same as github.com and gitlab.com.

## Understand your results

The header of the search view reports how many sessions matched, for example `12 of 340 sessions · best match first`. This count reflects everything that matched, not just the sessions already loaded in the sidebar.

- **No matches** — when nothing matches, the view says so and names your query, so an empty result is never confused with a search that didn't run.
- **Older sessions not searched** — for a large history, keyword search covers the most recent sessions and shows a notice when older ones fall outside that range. Add more distinctive words to your query to surface the session you want.

## Next steps

- [Getting started with Docs Agent](/agent/getting-started) — Create your first document in the editor.
- [Update and review](/agent/update-review) — Resume a session to keep docs in sync with code changes.