RAG analysis can be 100% generated with the Paradigm API. It allows users to submit a query, which the system processes to provide relevant answers by leveraging associated documents.
This endpoint is useful for:
- Searching content across multiple documents and scopes.
- Integrating document search into chat-based workflows.
- Enabling contextual and scoped responses using specific file or workspace data.
Example of API request using the requests package:
import requests
url = "https://paradigm.lighton.ai/api/v2"
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
payload = {
"query": "What is the termination clause in the contract?",
# Optional parameters (if not filled, same as UI search)
# "file_ids": ["abc123-file-id"],
"model": "alfred-4",
# "workspace_ids": [], # No workspace included
"company_scope": True, # Documents from the user's company will be added to the scope
"private_scope": True, # Private documents included
"tool": "DocumentSearch" # No vision (enter "VisionDocumentSearch" to enable vision)
}
response = requests.post(url, headers=headers, json=payload)
if response.status_code == 200:
data = response.json()
print("Answer:", data["answer"])
else:
print("Error:", response.status_code, response.text)