Architecture
InsightSpace separates browser access, application services, persistent data, document extraction, and AI inference. In the recommended split installation, inference runs on a separate GPU device connected to the application server over a private network.
The diagram below shows the compact single-device alternative: application, data, extraction, and local inference share one host, with Caddy as the user entry point. The same service responsibilities apply when inference is moved to a separate device.
Request path
Section titled “Request path”- A browser connects to the reverse proxy over HTTPS on the one InsightSpace hostname.
- The proxy sends paths under
/api/to the backend and everything else to the frontend. - The backend authorizes the user and workspace for each operation.
- Relational records and vector embeddings are stored in PostgreSQL with pgvector.
- Uploaded files and extraction artifacts are stored in S3-compatible object storage.
- The backend submits extraction work to the standalone extractor and receives structured chunks.
- Configured model providers supply chat, embedding, and reranking capabilities.
Network boundaries
Section titled “Network boundaries”The Compose topology separates an external web network from a private internal network.
- Caddy and the frontend are on the web network only.
- The backend is on both networks and connects the web tier to the private services.
- PostgreSQL, its backups, object storage, and the extractor are on the internal network, which has no outbound access.
- Local inference such as Ollama runs outside the Compose stack, on the host or the inference
device, and the backend reaches it at
LOCAL_INFERENCE_BASE_URL.
Only Caddy publishes ports (80 and 443). The backend accepts the client address and scheme from
X-Forwarded-For and X-Forwarded-Proto of whatever connects to it, so it must be reachable only
through the proxy; rate limiting and audit data depend on it.
Data boundaries
Section titled “Data boundaries”The backend owns tenant authorization and orchestration. The extractor is stateless: it holds no database, tenant state, or model-provider credentials. It processes one job in disposable scratch storage and returns structured content to the backend.
The extractor reads the source file through a presigned S3 URL. For stored results, the backend issues presigned upload URLs for the exact reported keys. The extractor holds no S3 credentials.
Persistence
Section titled “Persistence”Persistent data includes:
- PostgreSQL data and vector embeddings;
- S3 objects for source files and extraction artifacts;
- backend data-protection keys;
- database backups; and
- Caddy’s certificate data.
Extractor scratch space is temporary and should be mounted as tmpfs in the hardened container
posture. Container images and the extractor root filesystem are intended to be immutable.