# Search the Knowledge Base Directly

> Searches the firm's knowledge base and regulatory material for the query you supply. It returns ranked passages, each with its source, section, content…

POST /api/v1/skills/search.query/invoke

Searches the firm's knowledge base and regulatory material for the `query` you supply. It returns ranked passages, each with its source, section, content and confidence, plus counts by jurisdiction. Set `jurisdiction` to rank one region's material first; other regions are not excluded.

Body parameters

query string Required

The question or phrase to search the knowledge base for.

sources array of strings

Optional list of knowledge source names you would prefer; accepted today but does not yet narrow the results.

jurisdiction string

Optional region code such as UK, AU, US, CA or NZ; results from that region rank first and others are not excluded.

Returns

Skill executed successfully

skill string Required

Example search_knowledge

output object Required

output.stub_fields array of strings

output.warnings array of strings

output.results array of values

output.total_count integer · default 0

output.facets object

correlation_id string Required

Errors

Status Type When

401 AUTH.TOKEN_INVALID Authentication required

403 PERMISSION.CAPABILITY_DENIED Insufficient permissions

404 SKILL.NOT_FOUND Skill not found

422 VALIDATION.INVALID_FORMAT Validation error

429 RATE_LIMIT.USER Rate limit exceeded

5XX INTERNAL.UNKNOWN Internal server error

[Previous ← List Accessible Meetings in the Workspace](https://heyarchie.com/en-gb/developers/api-reference/utility/list-accessible-meetings-in-the-workspace/)[Next Approve or Reject a Workflow Item →](https://heyarchie.com/en-gb/developers/api-reference/utility/approve-or-reject-a-workflow-item/)

```
curl https://uk.heyarchie.com/api/v1/skills/search.query/invoke \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{
       "query": "string",
       "sources": [
         "string"
       ],
       "jurisdiction": null
     }'
```

```
from heyarchie import Archie
archie = Archie(api_key="sk_...")
result = archie.skills.invoke(
    "search.query",
    query="string",
    sources=["string"],
    jurisdiction=None,
)
print(result)
```

```
import { Archie } from "heyarchie";

const archie = new Archie({ apiKey: "sk_..." });
const result = await archie.skills.invoke("search.query", {
  "query": "string",
  "sources": [
    "string"
  ],
  "jurisdiction": null
});
console.log(result);
```

Response

```
{
  "skill": "search_knowledge",
  "output": {
    "facets": {
      "jurisdictions": {
        "UK": 1
      }
    },
    "results": [
      {
        "confidence": 0.87,
        "content": "A business must register for VAT when its taxable turnover goes over the registration threshold in any 12-month period.",
        "section": "p.12",
        "source": "VAT Notice 700/1"
      }
    ],
    "total_count": 1
  },
  "correlation_id": "<string>"
}
```

```
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "retry_after_seconds": "<integer>"
  }
}
```

Every response also carries X-Request-ID. Quote it if you write to us about a call.
