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

# Library search and agent grounding

> Find Library items with keyword and semantic search, filter the catalog, and control which items agents can retrieve.

Library search combines keyword matching with semantic similarity over indexed passages. Search results keep their item kind, provenance, version state, and agent availability visible.

## Search the catalog

Enter a phrase in the Library search field. DevTune ranks matching titles and indexed passages. If semantic ranking is temporarily unavailable for the first result page, search continues with keyword ranking.

The catalog shows Current versions from the last 90 days by default. Use the facets to narrow results by:

* **Kind**: Report, Brief, Upload, or Memory
* **Agent**: the managed agent that produced the item
* **Generated by**: User, System, or Agent
* **Status**: Current or Superseded
* **Date**: 30 days, 90 days, 1 year, or any date

Select **Show all versions** when an older version may contain the relevant evidence. Previous versions remain searchable; they are not merged into the Current item's content.

## Available to agents

Every Library item has an **Available to agents** switch. It is on by default.

* **On:** managed agents can retrieve matching passages from the item.
* **Off:** the item remains searchable and readable in the Library UI, but it is never retrieved into agent prompts.

The switch applies to that item, not to an entire provider or item kind. You need project management permission to change it.

## Version-aware retrieval

Agent retrieval uses Current items by default. Every retrieved passage is labeled with:

* the Library item ID
* the item title
* its version number
* **Current** or **Superseded** state
* the version's as-of date

An agent can deliberately request a specific older item version. DevTune does not silently combine a Superseded passage with the Current version or present old content without its version label.

Expired workflow memory and items with **Available to agents** turned off are excluded at retrieval and again when passages are loaded for a prompt.

## API and MCP search

* `GET /projects/{projectId}/library/search` performs hybrid search and returns Current versions by default. Set `includeSuperseded=true` for deliberate historical search.
* `GET /projects/{projectId}/library` lists the catalog without a search query.
* `devtune_search_library` and `devtune_list_library` expose the same Current-only default to MCP clients.
* `devtune_update_library_item` changes `groundingEnabled` when the connection has `library.write`.

The public search surface does not expose the in-app kind, agent, generator, or date facets. Filter those result fields in your client when needed.

See the [REST API endpoint list](/api-reference/overview#available-endpoints) and [MCP server guide](/api-reference/mcp-server#library-and-knowledge-permissions).

## Next steps

* [Understand Library items and versions](/library/overview)
* [Manage the Knowledge Profile and workflow memory](/library/knowledge)
