Architecture Overview
Nyravio separates the user-facing workspace from provider-specific model, retrieval, and tool integrations.
Technology stack
Section titled “Technology stack”| Component | Technologies |
|---|---|
| Backend | Java 21, Spring Boot 4.1, Spring Security |
| Frontend | Svelte 5, SvelteKit 3, TypeScript 6 |
| Styling | Tailwind CSS 4 |
| Build tools | Gradle 9 (backend), Vite (frontend) |
| Database | PostgreSQL 16, Flyway migrations |
| Vector search | pgvector |
| Document processing | Apache Tika 3.1 |
| Streaming | Server-Sent Events (SSE) |
| Models | OpenAI-compatible, Anthropic, Google, Ollama |
| Tools | Model Context Protocol (MCP) |
| Observability | Spring Boot Actuator, Micrometer, Prometheus |
| Deployment | Docker, Docker Compose |
System diagram
Section titled “System diagram” Nyravio Workspace Svelte / SvelteKit / TypeScript │ REST / SSE │ Java / Spring Boot │ ┌───────────────────────────────────────────────┐ │ Application Backend │ │ │ │ Identity & Access Conversations │ │ Context Engine Projects │ │ Memory Knowledge & Retrieval │ │ Model Adapters Agent Execution │ │ Tool Gateway Artifact Management │ │ Administration Background Tasks │ └───────────────────────────────────────────────┘ │ │ │ ▼ ▼ ▼ AI Providers MCP Servers PostgreSQL Local Models Apache Tika pgvector File StorageComponent boundaries
Section titled “Component boundaries”Frontend
Section titled “Frontend”Presentation, input, streaming display, and accessibility. The frontend never holds privileged provider credentials or tenant-wide secrets.
Application backend
Section titled “Application backend”Identity, authorization, tenant context, conversation state, context assembly, streaming protocol, audit events, quotas, and provider dispatch.
Provider adapters
Section titled “Provider adapters”Normalized model requests, streaming events, timeouts, retry eligibility, and usage reconciliation. Four adapters are implemented:
- OpenAI adapter — OpenAI API and OpenAI-compatible services
- Anthropic adapter — Claude models
- Google adapter — Gemini models
- Local adapter — Ollama and local models
Knowledge adapters
Section titled “Knowledge adapters”Access-controlled corpus ingestion and retrieval. Open integrations work independently of optional proprietary services.
Tool gateway
Section titled “Tool gateway”Per-user and per-tenant policy enforcement, approval, rate limits, audit, and sandboxing of untrusted operations. Supports MCP 2025-03-26 with Streamable HTTP and OAuth 2.1.
Optional services
Section titled “Optional services”Additional retrieval, audio processing, code execution, extraction, voice, and image generation. Failure or absence is observable and cannot corrupt core state.
Cross-cutting invariants
Section titled “Cross-cutting invariants”- Tenant identity comes from trusted authenticated context, never a client-controlled tenant header alone.
- Authorization is enforced at every data boundary and asynchronous continuation.
- SSRF protection — unknown or untrusted outbound URLs are validated against a policy.
- Content safety — model-generated HTML, citations, tool outputs, markdown links, and file references are treated as untrusted.
- Stream lifecycle — a stream may terminate because of client disconnect, tool cancellation, provider failure, quota, or normal completion. Each path has defined cleanup and accounting behavior.
- Fail closed — privileged features fail closed. Disabled optional capabilities are invisible or clearly unavailable.
Key subsystems
Section titled “Key subsystems”Context Engine
Section titled “Context Engine”Server-side context assembly with budget-aware prompt window management. Brings together conversation history, user instructions, project information, personal and project-scoped memory, and relevant knowledge. Applies history compression as conversations grow.
Knowledge pipeline
Section titled “Knowledge pipeline”Document ingestion → text extraction (Tika) → chunking → vector embedding → PostgreSQL/pgvector storage → hybrid search retrieval.
Agent execution
Section titled “Agent execution”Multi-step task orchestration with tool interaction, approval controls, progress monitoring, and execution limits.
Artifact Canvas
Section titled “Artifact Canvas”Dedicated workspace for code, documents, tables, charts, diagrams, vector graphics, and interactive components. Version history and diff comparison.
Repository structure
Section titled “Repository structure”backend/ Java backend — API, domain logic, adapters, testsfrontend/ Svelte frontend — UI, workspaces, settings, testsdocs/ Technical documentationdeploy/ (not present — compose.yaml is at root)For the complete directory layout, see Repository Layout.
Next steps
Section titled “Next steps”- Local Development — development environment setup
- Contributing — how to contribute