Ragpi | Ragpi Documentation

Ragpi (v0.4.x)

Download OpenAPI specification:Download

An open-source AI assistant answering questions using your docs

Healthcheck

Healthcheck

Authorizations:

APIKeyHeader

Responses

Response samples

Content type

application/json

{

  • "api": {

    • "status": "ok"

    },

  • "redis": {

    • "status": "ok"

    },

  • "postgres": {

    • "status": "ok"

    },

  • "workers": {

    • "status": "ok",

    • "active_workers": 2

    }

}

Sources

List Sources

Authorizations:

APIKeyHeader

Responses

Response samples

Content type

application/json

[

  • {

    • "id": "string",

    • "name": "string",

    • "description": "string",

    • "num_docs": 0,

    • "last_task_id": "string",

    • "created_at": "2019-08-24T14:15:22Z",

    • "updated_at": "2019-08-24T14:15:22Z",

    • "connector": {

      • "type": "sitemap",

      • "sitemap_url": "string",

      • "include_pattern": "string",

      • "exclude_pattern": "string"

      }

    }

]

Create Source

Authorizations:

APIKeyHeader

Request Body schema: application/json

required

name

required

string (Name) [ 3 .. 50 ] characters

description

required

required

Responses

Request samples

Content type

application/json

{

  • "name": "string",

  • "description": "string",

  • "connector": {

    • "type": "sitemap",

    • "sitemap_url": "string",

    • "include_pattern": "string",

    • "exclude_pattern": "string"

    }

}

Response samples

Content type

application/json

{

  • "task_id": "string",

  • "source": {

    • "id": "string",

    • "name": "string",

    • "description": "string",

    • "num_docs": 0,

    • "last_task_id": "string",

    • "created_at": "2019-08-24T14:15:22Z",

    • "updated_at": "2019-08-24T14:15:22Z",

    • "connector": {

      • "type": "sitemap",

      • "sitemap_url": "string",

      • "include_pattern": "string",

      • "exclude_pattern": "string"

      }

    },

  • "message": "string"

}

Get Source

Authorizations:

APIKeyHeader

path Parameters
source_name

required

Responses

Response samples

Content type

application/json

{

  • "id": "string",

  • "name": "string",

  • "description": "string",

  • "num_docs": 0,

  • "last_task_id": "string",

  • "created_at": "2019-08-24T14:15:22Z",

  • "updated_at": "2019-08-24T14:15:22Z",

  • "connector": {

    • "type": "sitemap",

    • "sitemap_url": "string",

    • "include_pattern": "string",

    • "exclude_pattern": "string"

    }

}

Update Source

Authorizations:

APIKeyHeader

path Parameters
source_name

required

Request Body schema: application/json

required

sync

boolean (Sync)

Default: true

Description (string) or Description (null) (Description)

Connector (any) or Connector (null) (Connector)

Responses

Request samples

Content type

application/json

{

  • "sync": true,

  • "description": "string",

  • "connector": {

    • "type": "sitemap",

    • "sitemap_url": "string",

    • "include_pattern": "string",

    • "exclude_pattern": "string"

    }

}

Response samples

Content type

application/json

{

  • "task_id": "string",

  • "source": {

    • "id": "string",

    • "name": "string",

    • "description": "string",

    • "num_docs": 0,

    • "last_task_id": "string",

    • "created_at": "2019-08-24T14:15:22Z",

    • "updated_at": "2019-08-24T14:15:22Z",

    • "connector": {

      • "type": "sitemap",

      • "sitemap_url": "string",

      • "include_pattern": "string",

      • "exclude_pattern": "string"

      }

    },

  • "message": "string"

}

Delete Source

Authorizations:

APIKeyHeader

path Parameters
source_name

required

Responses

Response samples

Content type

application/json

{

  • "detail": "Source 'example' not found"

}

Get Source Documents

Authorizations:

APIKeyHeader

path Parameters
source_name

required

query Parameters
limit

integer (Limit)

Default: 100

offset

integer (Offset)

Default: 0

Responses

Response samples

Content type

application/json

[

  • {

    • "id": "string",

    • "content": "string",

    • "title": "string",

    • "url": "string",

    • "created_at": "2019-08-24T14:15:22Z"

    }

]

Search Source

Authorizations:

APIKeyHeader

path Parameters
source_name

required

query Parameters
query

required

top_k

integer (Top K)

Default: 10

Responses

Response samples

Content type

application/json

[

  • {

    • "id": "string",

    • "content": "string",

    • "title": "string",

    • "url": "string",

    • "created_at": "2019-08-24T14:15:22Z"

    }

]

Chat

Chat

Authorizations:

APIKeyHeader

Request Body schema: application/json

required

Array of Sources (strings) or Sources (null) (Sources)

model

string (Model)

Default: "gpt-4o"

required

Array of objects (Messages)

Responses

Request samples

Content type

application/json

{

  • "sources": [

    • "string"

    ],

  • "model": "gpt-4o",

  • "messages": [

    • {

      • "role": "user",

      • "content": "string"

      }

    ]

}

Response samples

Content type

application/json

{

  • "message": "string"

}

Tasks

List Tasks

Authorizations:

APIKeyHeader

Responses

Response samples

Content type

application/json

[

  • {

    • "id": "string",

    • "status": "string",

    • "completed_at": "string",

    • "metadata": { }

    }

]

Get Task

Authorizations:

APIKeyHeader

path Parameters
task_id

required

Responses

Response samples

Content type

application/json

{

  • "id": "string",

  • "status": "string",

  • "completed_at": "string",

  • "metadata": { }

}

Terminate Task

Authorizations:

APIKeyHeader

path Parameters
task_id

required

Responses

Response samples

Content type

application/json

{

  • "message": "Terminating task 'example'"

}