Skip to main content

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.

Spy Search persists conversation history as named sessions. Each conversation is identified by a unique title string. The endpoints below allow you to list all saved titles, load a full conversation, add new messages to an existing one, and delete conversations you no longer need.

GET /get_titles

Returns a list of all saved conversation titles. Use this to discover which conversations are stored before loading or deleting one. Response format: application/json

Response

titles
string[]
An array of title strings representing all saved conversations.

Example

curl http://localhost:8000/get_titles
Example response:
{
  "titles": [
    "Renewable Energy Research",
    "Nobel Prize 2024",
    "Transformer Architecture Overview"
  ]
}

POST /load_message

Loads the full conversation associated with a given title, including all stored messages. Request format: application/json Response format: application/json

Request Body

title
string
required
The title of the conversation to load. Must match a title returned by GET /get_titles.Example: "Renewable Energy Research"

Response

Returns the stored conversation content object. The exact shape is determined by how the conversation was originally saved via POST /append_message, but will include all message history.

Example

curl -X POST http://localhost:8000/load_message \
  -H "Content-Type: application/json" \
  -d '{"title": "Renewable Energy Research"}'
Example response:
{
  "title": "Renewable Energy Research",
  "messages": [
    {"role": "user", "content": "What are the latest trends in renewable energy?"},
    {"role": "assistant", "content": "In 2024, the most significant trends include..."}
  ]
}

POST /append_message

Appends a single message to an existing saved conversation. If the conversation title does not yet exist, a new one is created. Request format: application/json Response format: application/json

Request Body

title
string
required
The title of the conversation to append the message to.Example: "Renewable Energy Research"
message
object
required
A Message object to append. Must contain both role and content fields.
{
  "role": "assistant",
  "content": "Solar capacity grew by 40% globally in 2024..."
}
Nested fields:
  • role (string, required) — the message role: "user", "assistant", or "system"
  • content (string, required) — the text content of the message

Response

status
string
The string "success" when the message was appended successfully.
message
string
A human-readable confirmation string indicating which conversation was updated.Example: "Appended message to title 'Renewable Energy Research'"

Example

curl -X POST http://localhost:8000/append_message \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Renewable Energy Research",
    "message": {
      "role": "assistant",
      "content": "Solar capacity grew by 40% globally in 2024, driven by cost reductions in photovoltaic panels."
    }
  }'
Example response:
{
  "status": "success",
  "message": "Appended message to title 'Renewable Energy Research'"
}
Error response (HTTP 500):
{
  "detail": "Failed to write conversation file"
}

POST /delete_message

Deletes a saved conversation by its title. If no conversation with the given title exists, a 404 error is returned. Request format: application/json Response format: application/json

Request Body

title
string
required
The title of the conversation to delete.Example: "Nobel Prize 2024"

Response

status
string
The string "success" when the conversation was deleted.
message
string
A human-readable confirmation string.Example: "Message with title 'Nobel Prize 2024' deleted"

Example

curl -X POST http://localhost:8000/delete_message \
  -H "Content-Type: application/json" \
  -d '{"title": "Nobel Prize 2024"}'
Example response:
{
  "status": "success",
  "message": "Message with title 'Nobel Prize 2024' deleted"
}
Not found response (HTTP 404):
{
  "detail": "Message with title 'Nobel Prize 2024' not found"
}

Build docs developers (and LLMs) love