← BACK TO SYSTEM MAP

SYSTEM 09

KULAI MEMORY

Personal AI memory system powered by local models and semantic search.

Android and desktop interfaces for recording voice notes, retrieving information with RAG and interacting with a local AI assistant. The backend runs on private infrastructure with PostgreSQL, Whisper, BGE-M3 and Qwen.

PYTHONFASTAPIPOSTGRESQLPGVECTORWHISPERBGE-M3QWENKOTLINPYSIDE6

SYSTEM IDENTITY

STATUSWORKING PRIVATE PROTOTYPE

TYPELOCAL AI / RAG / MOBILE + DESKTOP

DEPLOYMENTPrivate infrastructure

01 / PROBLEM & PURPOSE

A place for ideas worth remembering

Ideas, useful details and decisions often arrive when opening a notebook and organising a new entry would interrupt the task at hand. Later, finding that one detail can mean searching through scattered notes without remembering the original wording.

KulAI Memory is a private project built around this everyday problem: capture a thought by voice, keep it in durable storage and ask for the relevant information later. Semantic search makes retrieval depend on meaning rather than an exact phrase.

02 / APPLICATION SCREENSHOTS

KULAI MEMORY IN ACTION

03 / CORE FUNCTIONS

Capture, retrieve and converse

01

NOTE

Record a voice note, transcribe it with Whisper and store its text as a durable Memory.

02

MEMORY

Browse saved information in the Memory library and return to earlier notes.

03

ASK

Ask a question by text or voice. RAG retrieves relevant saved notes and gives Qwen the context needed for an answer with source references.

04

CHAT

A separate multi-turn conversation mode in the Android client, with persisted conversation history. CHAT is distinct from ASK; it does not promise a search of the entire memory on every turn.

05

TTS

Read answers aloud locally in Polish and English using installed speech voices.

04 / RAG PIPELINE

From a voice note to a grounded answer

Voice note ingestion

  1. VOICE
  2. WHISPER
  3. TEXT
  4. POSTGRESQL / PGVECTOR

Whisper converts speech to text. PostgreSQL stores the canonical note; a separate indexing step creates its BGE-M3 embedding and saves the vector through pgvector.

Question and semantic retrieval

  1. QUESTION
  2. BGE-M3
  3. SEMANTIC RETRIEVAL
  1. RELEVANT MEMORIES
  2. QWEN
  3. ANSWER

For ASK, BGE-M3 represents the question as a vector. Semantic retrieval selects relevant memories, and Qwen uses that context to compose an answer. When no useful context is available, ASK reports insufficient information rather than inventing a memory.

BGE-M3 and Qwen are existing pretrained models. My work is the application, orchestration, persistence and RAG mechanism that connects those models to private notes.

05 / SYSTEM ARCHITECTURE

Two interfaces, explicit application boundaries

Android request path

  1. ANDROID / COMPOSE
  2. FASTAPI
  3. APPLICATION CORE

Desktop execution path

  1. DESKTOP / PYSIDE6
  2. IN-PROCESS CALLS
  3. APPLICATION CORE

The Android interface uses Kotlin and Jetpack Compose and communicates with FastAPI over HTTP and WebSocket. The PySide6 desktop application invokes the application core directly in its own process; it does not start or call FastAPI for this workflow.

The application core handles persistence in PostgreSQL/pgvector and model orchestration. Whisper handles transcription, BGE-M3 produces embeddings and Qwen generates answers; model inference runs on a privately controlled computer, with BGE-M3 and Qwen served through Ollama.

06 / SECURITY & PRIVATE AI

Private notes, locally controlled inference

Notes and embeddings are stored in private PostgreSQL infrastructure. Speech recognition, embeddings and answer generation use local model runtimes, so this workflow does not require sending note content to a hosted AI service.

The secure access layer implements HTTPS/WSS transport with mutual TLS at the ingress, device authorization and renewable sessions. Device pairing requires local administrator approval. Access is reserved for approved devices in a private installation.

07 / ENGINEERING DECISIONS

Reliability beyond a model response

E-01

DURABLE DATA

PostgreSQL keeps canonical notes, vector indexes and conversation records beyond an application restart. Schema changes use explicit migrations.

E-02

STABLE OPERATION IDS

Ingestion and conversation requests carry stable UUIDs. Retrying a completed operation can reuse its stored result instead of creating a duplicate.

E-03

TRANSACTION BOUNDARIES

Canonical writes use transaction and conflict controls. Retrieval closes its database snapshot before model generation, and a conversation turn is saved as a complete question-and-answer pair.

E-04

SEMANTIC SEARCH

BGE-M3 embeddings and pgvector let ASK find notes by meaning. Source references keep the generated answer connected to the retrieved material.

E-05

SEPARATE MODEL ROLES

Whisper, BGE-M3 and Qwen have separate transcription, embedding and generation responsibilities, connected through application-level orchestration.

E-06

HISTORY & ERROR HANDLING

Conversation history is persisted with ordered messages and bounded context. Typed errors, cancellation handling and retries with stable request IDs support recovery from interrupted operations.

08 / TECH STACK & CURRENT STATUS

A working private prototype

Python
FastAPI
PostgreSQL 18
pgvector
Whisper
BGE-M3
Qwen
Ollama
Kotlin / Jetpack Compose
PySide6
Secure access infrastructure

KulAI Memory is a working private prototype, under development and tested on a physical Android device.

The project demonstrates end-to-end application engineering around local AI: client interfaces, backend boundaries, durable data, retrieval and controlled access.