Get matching sections


Retrieves a list of sections that match a prompt.

The /sections endpoint is available as part of the Enterprise plan.

Request body

promptstringThe input prompt.
sectionsMatchCountnumberThe number of sections to retrieve. Default: 10.
sectionsMatchThresholdnumberThe similarity threshold between the input prompt and selected sections. The higher the threshold, the more relevant the sections. If it's too high, it can potentially miss some sections. Default: 0.5.
maxContextTokensnumberThe maximum number of tokens that the returned sections fill. Default: 10000.
ragTypebasic | smallToBigThe RAG strategy. If set to basic, sections whose embeddings satisfy the minimum similarity score against the input prompt are returned. If set to smallToBig, search for section matches is extended to include neighboring content, as long as it fits within the maxContentTokens constraint. Note that smallToBig RAG type is an enterprise-only feature

Example request

1curl "" \
2  -X GET \
3  -H "Authorization: Bearer <TOKEN>" \
4  -H "Content-type: application/json" \
5  -H "Accept: application/json" \
6  -H "X-Markprompt-API-Version: 2024-03-23"


The response is of the form:

2  data: [
3    {
4      path: "/path/to/section/1",
5      content: "Section 1 content...",
6      similarity: 0.89
7    },
8    {
9      path: "/path/to/section/2",
10      content: "Section 2 content...",
11      similarity: 0.72
12    },
13    ...
14  ]