Architecture overview
Understand the boundaries between the desktop interface, local services, storage, and AI calls.
Application components
KnowRealm uses Tauri 2, React, and TypeScript. A local FastAPI service starts with the desktop app to handle application actions, tasks, and data access. Regular users do not need to deploy a separate service.
Desktop interface
↓ Local API
Local application service and task processing
├─ SQLite application database
├─ Local source files and configuration
└─ Model, transcription, and search services as neededThe website is a separate Next.js project. It is not an online edition of the desktop app and does not share desktop users' data folders.
Local data
SQLite and local files hold application facts. Search indexes can be rebuilt and do not replace original resources. The local API binds to the local machine and uses a startup token; it is not a public general purpose service.
See Data and privacy for data folders, export, and migration.
Shared application capabilities
Interface actions and assistant actions reuse application services. Validation, scheduling, and statistics that can be handled deterministically use program rules. Language understanding, summaries, and generation call models when needed.
Assistant writes go through controlled execution and authorization. The model does not directly make arbitrary database changes. Durable application facts live in the application database; conversation execution state is not the sole record of an action.
Background tasks and recovery
Time consuming work such as transcription, summarization, exercise generation, and grading runs through local tasks. A chat turn and a multistep application action store separate states. Leaving a page, canceling, and retrying mean different things.
Recovery must be verified for specific scenarios. Persisted state does not imply lossless recovery from every interruption. See Documentation version for current validation boundaries.
Code directories
| Directory | Purpose |
|---|---|
apps/desktop/ | Desktop interface and Tauri native layer |
backend/ | Local application services, tasks, and assistants |
packages/api-types/ | Shared API types |
docs/ | Requirements, terminology, architecture decisions, and development rules |
Before developing, read Development and contributions and the repository's current rules.