make
./bin/mint -p 8080 data
# with argo cli
argo run -p 8080 data
mint -p PORT_NUMBER DATA_PATH
Endpoint: /upsert
Method: POST
Description: Upserts a document into the specified table. If no table is specified, the default table is used.
Request Body:
- JSON document containing the data to be upserted.
Response:
- 200 OK: If the document is successfully upserted.
- 500 Internal Server Error: If there is an error during upsertion.
Example: { "title": "Sample Title", "content": "Sample content", "embeddings": [0.1, 0.2, 0.3, ...] }
Endpoint: /query
Method: POST
Description: Queries documents from the specified table based on the provided embeddings. If no table is specified, the default table is used.
Request Body:
- JSON document containing the embeddings to query.
Response:
- 200 OK: Returns a JSON array of matching documents.
Example: { "embeddings": [0.1, 0.2, 0.3, ...] }
Endpoint: /print
Method: GET
Description: Prints the titles of documents in the cache.
Response:
- 204 No Content: If titles are printed successfully.
Endpoint: /health
Method: GET
Description: Checks the health status of the server.
Response:
- 200 OK: Returns a JSON object indicating the server is healthy.
Example: { "ok": true, "message": "all good 😎" }
Endpoint: /echo
Method: POST
Description: Echoes back the request body.
Request Body:
- Any text content.
Response:
- 200 OK: Returns the same text content.
Endpoint: /drop
Method: DELETE
Description: Drops the specified table. If no table is specified, the default table is dropped.
Response:
- 204 No Content: If the table is successfully dropped.
- 404 Not Found: If there is an error deleting the table.
Endpoint: /dev/upsert
Method: POST
Description: Developer version of the upsert endpoint with additional logging.
Request Body:
- JSON document containing the data to be upserted.
Response:
- 200 OK: If the document is successfully upserted.
- 500 Internal Server Error: If there is an error during upsertion.
Endpoint: /dev/query
Method: POST
Description: Developer version of the query endpoint with a fixed sample response.
Request Body:
- JSON document containing the embeddings to query.
Response:
- 200 OK: Returns a fixed sample JSON array of documents.
Endpoint: /dev/print
Method: GET
Description: Developer version of the print endpoint with additional logging.
Response:
- 204 No Content: If titles are printed successfully.
- 200 OK: The request was successful.
- 204 No Content: The request was successful but there is no content to return.
- 404 Not Found: The requested resource was not found.
- 500 Internal Server Error: An error occurred on the server.
curl -X POST http://localhost:8080/upsert/:table -d '{
"title": "Sample Title",
"content": "Sample content",
"embeddings": [0.1, 0.2, 0.3, ...]
}' -H "Content-Type: application/json"
curl -X POST http://localhost:8080/query/:table -d '{
"embeddings": [0.1, 0.2, 0.3, ...]
}' -H "Content-Type: application/json"
curl http://localhost:8080/health
curl -X POST http://localhost:8080/echo -d 'Hello, World!' -H "Content-Type: text/plain"
curl -X DELETE http://localhost:8080/drop/:table