Talk with Archie
API reference › Utility
Skills › Utility

Search the Knowledge Base Directly

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
querystringRequired
The question or phrase to search the knowledge base for.
sourcesarray of strings
Optional list of knowledge source names you would prefer; accepted today but does not yet narrow the results.
jurisdictionstring
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

skillstringRequired
Example search_knowledge
outputobjectRequired
output.stub_fieldsarray of strings
output.warningsarray of strings
output.resultsarray of values
output.total_countinteger · default 0
output.facetsobject
correlation_idstringRequired
Errors
StatusTypeWhen
401AUTH.TOKEN_INVALIDAuthentication required
403PERMISSION.CAPABILITY_DENIEDInsufficient permissions
404SKILL.NOT_FOUNDSkill not found
422VALIDATION.INVALID_FORMATValidation error
429RATE_LIMIT.USERRate limit exceeded
5XXINTERNAL.UNKNOWNInternal server error
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>"
  }
}
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "retry_after_seconds": "<integer>"
  }
}
{
  "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.