Skip to main content
GET
/
api
/
updates
{
  "file_parsing": {
    "file_size": 123,
    "file_type": "<string>"
  },
  "file_summarizing": {
    "content_length": 123,
    "llm_backend": "<string>"
  },
  "file_embedding": {
    "model": "<string>",
    "embedding_dim": 123
  },
  "file_complete": {
    "total_time": 123,
    "title": "<string>"
  },
  "file_failed": {
    "error": "<string>",
    "stage": "<string>"
  }
}
Stream real-time processing status updates via Server-Sent Events (SSE). Perfect for monitoring indexing progress in real-time.

Request

No parameters required. This endpoint returns a long-lived SSE connection.

Request Example

cURL
curl -N http://localhost:60534/api/updates
Python
import requests
import json

response = requests.get(
    'http://localhost:60534/api/updates',
    stream=True
)

for line in response.iter_lines():
    if line:
        decoded = line.decode('utf-8')
        if decoded.startswith('data: '):
            event = json.loads(decoded[6:])
            print(f"[{event['type']}] {event['path']}")
JavaScript
const eventSource = new EventSource('http://localhost:60534/api/updates');

eventSource.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log(`[${data.type}] ${data.path}`);
};

eventSource.onerror = (error) => {
  console.error('SSE error:', error);
  eventSource.close();
};

Event Format

Each SSE event is sent in this format:
data: {"type": "file_parsing", "path": "/path/to/file.txt", "metadata": {...}}

Event Types

file_parsing
event
File is being parsed by MarkItDown
file_summarizing
event
AI is generating summary and keywords
file_embedding
event
Creating vector embedding for semantic search
file_complete
event
File successfully indexed and ready for search
file_failed
event
Error occurred during processing

Event Stream Example

data: {"type": "file_parsing", "path": "/Users/username/Downloads/report.pdf", "metadata": {"file_size": 1048576, "file_type": "pdf"}}

data: {"type": "file_summarizing", "path": "/Users/username/Downloads/report.pdf", "metadata": {"content_length": 5234, "llm_backend": "ollama"}}

data: {"type": "file_embedding", "path": "/Users/username/Downloads/report.pdf", "metadata": {"model": "e5-base-v2", "embedding_dim": 768}}

data: {"type": "file_complete", "path": "/Users/username/Downloads/report.pdf", "metadata": {"total_time": 3245, "title": "Q4 Financial Report"}}

data: {"type": "file_failed", "path": "/Users/username/Downloads/corrupted.xlsx", "metadata": {"error": "Unable to parse file: File is corrupted", "stage": "parsing"}}

Use Cases

1. Progress Monitoring (TUI)

The TUI uses this endpoint to show real-time indexing status:
async for event in sse_stream('/api/updates'):
    status_bar.update(f"Processing: {event['path']}")

2. Custom Progress UI

Build your own progress interface:
const stats = {
  parsing: 0,
  summarizing: 0,
  embedding: 0,
  complete: 0,
  failed: 0
};

eventSource.onmessage = (event) => {
  const data = JSON.parse(event.data);
  stats[data.type.replace('file_', '')]++;
  updateProgressBar(stats);
};

3. Error Monitoring

Track and log failures:
for event in sse_stream():
    if event['type'] == 'file_failed':
        logger.error(f"Failed to index {event['path']}: {event['metadata']['error']}")
This is a long-lived HTTP connection. Make sure your HTTP client supports streaming responses and doesn’t timeout on long connections.
The TUI automatically subscribes to this endpoint and displays updates in the status bar. You can see real-time progress without polling.