Skip to content

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.

InsightSpace single-appliance architecture showing users, Caddy, the frontend, backend, PostgreSQL, Garage object storage, the extractor, Ollama, backups, and internal and external networks.

  1. A browser connects to the reverse proxy over HTTPS on the one InsightSpace hostname.
  2. The proxy sends paths under /api/ to the backend and everything else to the frontend.
  3. The backend authorizes the user and workspace for each operation.
  4. Relational records and vector embeddings are stored in PostgreSQL with pgvector.
  5. Uploaded files and extraction artifacts are stored in S3-compatible object storage.
  6. The backend submits extraction work to the standalone extractor and receives structured chunks.
  7. Configured model providers supply chat, embedding, and reranking capabilities.

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.

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.

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.