# Search knowledge collections

Source: <https://everruns.com/docs/api/operations/search_knowledge_collections/>

[Docs](https://everruns.com/docs/)/[API reference](https://everruns.com/docs/api/)/[Knowledge & memory](https://everruns.com/docs/api/groups/knowledge-memory/)/Search knowledge collections

# Search knowledge collections

Preview

Give agents persistent memory and versioned file collections. Manage sources, files and optional search indexes.

Public APIEverruns Cloud and self-hosted Platform

POST`/v1/knowledge/search`

See [authentication](https://everruns.com/docs/sre/runbooks/authentication/) for credentials and permissions.

## Request Bodyrequired

Media typeapplication/json

A bounded retrieval query; runtime hosts intersect collections with live session bindings.

object

**collections**

Optional collection identifiers. Runtime access remains limited to attached collections.

Array\<string>

**lexical_only**

Use keyword retrieval without creating a query embedding.

boolean

**limit**

Requested maximum passages; hosts enforce the configured retrieval budget.

integer

**metadata**

Exact user-annotation predicates applied without granting additional file access.

object

**_key_**

additional properties

**path**

Optional source-relative path prefix that narrows retrieval.

string | null

**query**

required

Search text used for keyword retrieval and, when enabled, query embeddings.

string

### Example generated

```json
{
  "collections": [
    "example"
  ],
  "lexical_only": true,
  "limit": 1,
  "metadata": {
    "additionalProperty": "example"
  },
  "path": "example",
  "query": "example"
}
```

## Responses

200Versioned search results

### 200

Versioned search results

Media typeapplication/json

### Example generated

```json
example
```

FetchcURL

Request

```js
const url = 'https://app.everruns.com/api/v1/knowledge/search';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"collections":["example"],"lexical_only":true,"limit":1,"metadata":{"additionalProperty":"example"},"path":"example","query":"example"}'
};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

Request

```sh
curl --request POST \
  --url https://app.everruns.com/api/v1/knowledge/search \
  --header 'Content-Type: application/json' \
  --data '{ "collections": [ "example" ], "lexical_only": true, "limit": 1, "metadata": { "additionalProperty": "example" }, "path": "example", "query": "example" }'
```

Additional language examples require JavaScript. The default request example is available above.

200

200 · Versioned search results

No response body example is declared for this status.

## Matching endpoints