Welcome
The CosmaSense backend exposes a RESTful API for managing file indexing and search operations. The backend runs on port60534 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:Core Endpoints
Watch Directory
Add a directory to the watch list and start indexing
Search Files
Search indexed files using natural language queries
Get Watched Directories
List all directories currently being watched
Real-time Updates
Stream processing status updates via Server-Sent Events
Response Format
All API responses follow a consistent JSON format:Data Flow
Rate Limiting
The backend does not implement rate limiting as it’s designed for local use only. However, the TUI implements client-side throttling (0.5s) for search queries to reduce unnecessary API calls.File Processing States
When files are being indexed, they go through several states:| State | Description |
|---|---|
pending | File discovered, waiting to be processed |
parsing | Extracting content from file |
summarizing | AI generating summary and keywords |
embedding | Creating vector embedding |
complete | Successfully indexed |
failed | Error during processing |
/api/updates SSE endpoint.