Skip to main content

Welcome

The CosmaSense backend exposes a RESTful API for managing file indexing, search, queue control, and real-time updates. The backend runs on port 60534 by default. Base URL: http://localhost:60534 All endpoints are local-only and require no authentication. The backend is designed to run on your local machine and is not intended to be exposed to the internet.

Quick Start

Start the backend server:
cosma serve
Test the connection:
curl http://localhost:60534/api/status/

Endpoint Groups

Data Flow

File Processing States

When files are being indexed, they go through several states reported via SSE:
StateSSE OpcodeDescription
Queuedqueue_item_addedFile added to indexing queue, waiting for cooldown
Processingqueue_item_processingCooldown expired, processing started
Parsingfile_parsingExtracting content from file
Summarizingfile_summarizingAI generating summary and keywords
Embeddingfile_embeddingCreating vector embedding
Completefile_completeSuccessfully indexed
Failedfile_failedError during processing
Monitor these states in real-time using the /api/updates SSE endpoint.