Spy Search supports a local Retrieval-Augmented Generation (RAG) workflow. Documents are stored in named folders on the server, and the active folder is used to augment search and chat responses with content from your own files. The endpoints below cover the full lifecycle of RAG folder and file management.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JasonHonKL/spy-search/llms.txt
Use this file to discover all available pages before exploring further.
GET /folder_list
Returns all RAG folders and their contents. Response format:application/json
Response
An array of
FolderContent objects. Each object contains:foldername(string) — the name of the foldercontents(string[]) — list of filenames within the folder
Example
POST /create_folder
Creates a new RAG folder on the server. Request format:application/json
Response format: application/json
Request Body
The name or relative path for the new folder to create within the RAG
directory.Example:
"research_papers" or "2024/q1_reports"Response
true if the folder was created successfully, false otherwise.Example
GET /select_folder
Sets the active RAG folder. After calling this endpoint, subsequent search and chat requests will use documents from the selected folder for retrieval-augmented context. Response format:application/json
Query Parameters
The name of the folder to make active. Must match an existing folder returned
by
GET /folder_list.Response
true if the folder was selected successfully.The name of the folder that was activated.
Example
POST /upload_file
Uploads a file into an existing RAG folder. The file is stored on the server and becomes available for vector indexing and retrieval. Request format:multipart/form-data
Response format: application/json
Form Parameters
The file to upload. Sent as a multipart file field.
The target folder name where the file should be stored. Must be an existing
folder (create it first with
POST /create_folder if needed).Example: "research_papers"Response
true if the file was uploaded successfully, false if the upload failed.The original filename of the uploaded file.
The target folder path the file was uploaded to.
Example
POST /delete_file
Deletes a file from the RAG directory. The file path is passed as a query parameter. Response format:application/json
Query Parameters
The path to the file to delete, relative to the RAG root directory.Example:
"research_papers/transformer_survey.pdf"Response
true if the file was deleted, false if deletion failed.The path of the file that was deleted (echoed from the request).
Example
GET /download_file/{filepath:path}
Downloads a file from the RAG directory as a binary stream. The:path converter in the route pattern preserves forward slashes, so nested folder paths can be passed directly without URL-encoding the slashes.
Response format: application/octet-stream
Path Parameters
The relative path to the file within the RAG directory, including the folder
name and filename. Forward slashes are preserved by the
:path converter.Example: research_papers/transformer_survey.pdfResponse
Returns the raw binary content of the file as an attachment withContent-Disposition: attachment set to the filename. An HTTP 404 is returned if the file does not exist.