EasyRAG API Documentation

Search

Endpoint:http://easyrag.com/api/v1/search

Method:POST

Description: Queries the data with the provided text question and retrieves relevant documents.

Request Body:
{
  "query": "string",
  "table_id": "string,
  "reranker_enabled": "boolean",
  "returned_elements": "number"
}
Response:
[
  {
    "id": "string",
    "data": "string",
    "similarity": "number"
  }
]

Optional inputs:

  • reranker_enabled: Defaults to false. Only available for pro plan.
  • returned_elements: Defaults to 10.

Ask LLM

Endpoint:http://easyrag.com/api/v1/ask_llm

Method:POST

Description: Sends the question to the LLM and retrieves a response based on the search results.

Request Body:
{
  "query": "string",
   "table_id": "string,
  "reranker_enabled": "boolean",
  "returned_elements": "number"
}
Response:
{
  "response": "string"
}

Optional inputs:

  • reranker_enabled: Defaults to false. Only available for pro plan.
  • returned_elements: Defaults to 10.

Upload Data

Endpoint:http://easyrag.com/api/v1/upload_data

Method:POST

Description: Uploads a list of data containing an ID and text, and stores embeddings.

Request Body:
{
  "data": [
    {
      "id": "string",
      "table_id": "string,
      "text": "string"
    }
  ]
}
Response:
{
  "message": "string",
  "error": "string (optional)"
}

Delete Data

Endpoint:http://easyrag.com/api/v1/delete_data

Method:POST

Description: Deletes the data associated with the provided list of IDs.

Request Body:
{
  "ids": ["string"]
}
Response:
{
  "message": "string",
  "error": "string (optional)"
}

Update Data

Endpoint:http://easyrag.com/api/v1/update_data

Method:POST

Description: Updates existing data with a list of items containing an ID and text.

Request Body:
{
  "data": [
    {
      "id": "string",
      "text": "string"
    }
  ]
}
Response:
{
  "updated": ["string"],
  "not_found": ["string"]
}