Developer Preview

Build with
Liquid Intelligence

Library Mind API transforms static documents into queryable, semantic knowledge bases. Seamlessly integrate context-aware retrieval and literary personalities into your applications.

Authentication

Authenticate requests using a Bearer token. Tokens carry the permissions of the user who generated them. Keep your keys secure and never expose them in client-side code.

Security Best Practice

Rotate your production keys every 90 days. If a key is compromised, revoke it immediately via the Portal.

Authorization: Bearer lm_sk_live_...
GET

My Library

Retrieve a list of all your analyzed documents and their IDs. Use these IDs to initiate Knowledge Chat sessions.

import requests

url = "https://librarymind.com/api/v1/library/index"
headers = {"Authorization": "Bearer YOUR_KEY"}

response = requests.get(url, headers=headers)
print(response.json())
POST

Analyze Document

Upload raw documents (PDF, DOCX, TXT) for vectorization. The system processes the file, extracts semantic meaning, and indexes it for rapid retrieval. The analyzed document is automatically added to your library.

Token Consumption

Analysis operations are computationally expensive. Each document consumes 2,000 credits from your quota.

Multipart Form Parameters

  • fileRequired • File
    The document (PDF, DOCX, TXT)
  • fileNameRequired • String
    Display name for the book in your library

cURL File Upload Tip

When using cURL, prefix the local file path with an @ symbol (e.g., file=@/path/to/doc.pdf). Do not use the file:// protocol.

import requests

url = "https://librarymind.com/api/v1/library/analyze"
headers = {"Authorization": "Bearer YOUR_KEY"}
files = {"file": open("whitepaper.pdf", "rb")}
data = {"fileName": "Q4 Research"}

response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())
POST

Delete Document

Remove a document from your library and delete its associated data.

Windows cURL Tip: Use double quotes and escape internal quotes for the data payload:
-d "{\"title\": \"document_id\"}"

Body Parameters

  • titleRequired • String
    Use the original name of the book (returned as originalFileName in My Library) to delete it.
import requests

url = "https://librarymind.com/api/v1/library/delete"
headers = {"Authorization": "Bearer YOUR_KEY"}
json_data = {"title": "originalFileName"}

response = requests.post(url, headers=headers, json=json_data)
print(response.json())
POST

Knowledge Chat

In Development

The core endpoint for retrieval. Send a user prompt along with a document title to receive a context-aware response generated by the underlying LLM.

Body Parameters

  • titleRequired • String
    The title (identifier) of the analyzed book
  • messageRequired • String
    The question or prompt for the AI
import requests

url = "https://librarymind.com/api/v1/chat"
headers = {"Authorization": "Bearer YOUR_KEY"}
json_data = {
    "title": "Karel Capek - RUR",
    "message": "Who is Rossum?"
}

response = requests.post(url, headers=headers, json=json_data)
print(response.json())
POST

AI Personalities

In Development

Interact with simulated literary giants. Our models are fine-tuned on the works and correspondence of historical figures to provide authentic dialogue.

Body Parameters

  • personality_idRequired • String
    The unique ID of the personality
  • messageRequired • String
    The message for the AI personality
import requests

url = "https://librarymind.com/api/v1/chat"
headers = {"Authorization": "Bearer YOUR_KEY"}
json_data = {
    "personality_id": "capek-1",
    "message": "What is your view on robotics?"
}

response = requests.post(url, headers=headers, json=json_data)
print(response.json())