search
search

Everything a client reads to answer one question, in one request

Changed on

Search, each result's read and edges, the repeal listing, the counterparts of the results' clashes and repeals, their documents (no text), the curations of each clash side, the source types, the rules (in pot) and the POT's related open gaps.

The engine gathers; it does not judge. Each section is the body of its standalone route. A section whose reads fail is named in meta.partial; only search failing fails this.

post/pots/{pot_id}/ask-context

Request

Path parameters

pot_idstring required

POT identifier (UUID or slug)

Request body

querystring required

Natural language search query

top_kinteger

Maximum number of results to return

min_pot_scorenumber

Minimum POT Index threshold for results

min_similaritynumber nullable

Drop results whose raw similarity to the query is below this. Omitted = the server default (SEARCH_MIN_SIMILARITY, 0.20). 0 returns everything, as before.

relative_cutoffnumber nullable

Also drop results whose similarity is below this fraction of the best result's (e.g. 0.6 keeps those at least 60% as similar as the top one). Omitted = off.

as_ofstring date nullable

Day to judge validity on (ISO 8601). Each result says whether it is in force that day (currency); nothing is excluded. Omitted = today (UTC). A future day answers what will be in force then.

include_contentboolean

Include full fact content in results (set false for compact response)

languagestring nullable

Language of the source-type template labels (es, en, ca; else en).

Example request

{
  "filters": {
    "domain": "architecture"
  },
  "min_pot_score": 0.4,
  "query": "How does POT Index propagate through edges?",
  "top_k": 10
}

Response

Successful Response

searchobject required

POST /pots/{id}/search's body (no content).

factsobject required

GET /pots/{id}/facts/{fid} for each result, then each counterpart.

counterpartsstring[] required

Fact ids added beyond the results.

documentsobject
curationsobject

Example response

{
  "pot": {
    "constitution": {
      "approved_by": "system",
      "fact_count": 3,
      "facts": [
        {
          "content": "SciPot builds memory infrastructure for AI agents",
          "id": "const_001",
          "level": "CONSTITUTION",
          "pot_score": 1
        }
      ],
      "last_updated": "2026-01-06T10:30:45Z",
      "version": "1.0"
    },
    "created_at": "2026-01-06T10:30:45.123456Z",
    "description": "A POT about SciPot itself",
    "id": "018d1e8c-7b29-7a3e-8c1d-5e9a1c2d3e4f",
    "name": "SciPot Meta-POT",
    "slug": "scipot-pot",
    "updated_at": "2026-01-06T10:30:45.123456Z",
    "workspace_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Changes