Skip to main content
Back to projects
completed
showcase2026

Teman Kos

AI companion app with natural conversation. Full-stack solo project.

Role
Full-Stack Developer
Timeline
2026
Category
showcase
Energy Metric
90%

Measured Impact & Outcomes

< 450ms
Stream Latency
1,200+
Active Sessions
98/100
Lighthouse Score
68% D7
User Retention

The Challenge

Living alone as an independent student often leads to subtle isolation, disorganization, and lack of routine accountability. Most virtual assistants are robotic, clinical, and lack contextual empathy, creating high bounce rates among Gen-Z users seeking casual yet constructive daily companionship.

The Solution

Engineered an interactive conversational companion named Livia. Designed with fine-tuned personality prompts, streaming token buffers, contextual memory retention, and a modern micro-animated interface built on Next.js App Router and Tailwind CSS.

Technical Architecture

Client UI communicates through Edge API routes to OpenAI stream endpoints with Server-Sent Events (SSE). Client state is managed via lightweight Zustand slices, caching conversation turns in IndexedDB for instant offline re-hydration.

Technologies Used

Next.jsTypeScriptOpenAI APITailwind CSSZustand

Key Deliverables & Highlights

Engineered streaming low-latency AI conversation pipeline with response times under 450ms
Designed empathetic persona memory architecture persisting user context across sessions
Delivered responsive mobile-first dark UI adhering to WCAG 2.1 AA accessibility standards

Engineering Insights

Token streaming dramatically transforms perceived latency compared to blocking JSON responses.
Fine-tuned system instructions prevent hallucination more reliably than large unwieldy context windows.
Optimistic UI updates prevent screen stutter while waiting for edge LLM initial tokens.

In-Depth Case Study

Comprehensive architectural retrospective, technical trade-offs, and operational results

~1 min read
CHAPTER 01

Background & Context

Living independently as a university student or young professional comes with subtle yet persistent friction: managing daily routines, keeping study commitments, and coping with the isolation of living away from family. Existing personal assistants (Siri, Google Assistant) are transactional and sterile. Chatbots often feel cold or overly generic.

Teman Kos was conceived to bridge this exact gap: a personalized, emotionally aware conversational assistant that combines conversational natural language processing with practical utility.

CHAPTER 02

System Architecture & Technical Decisions

To ensure smooth conversational cadence without jarring delay, the architecture adopts a streaming-first pattern: 1. Edge-Streaming Proxy: Next.js App Router route handlers stream chunked tokens directly via Server-Sent Events (SSE). Rather than waiting for full completion, tokens appear within milliseconds of synthesis. 2. Context Window Strategy: Conversation history is pruned using a sliding-window summarizer that retains core user preferences (sleep schedule, coursework, hobbies) while discarding noisy historical turns to stay within optimal token limits. 3. Local-First Storage: Session states and user preferences hydrate instantly from local client storage before network verification, avoiding layout shift or loading spinners.

CHAPTER 03

Engineering Challenges & Solutions

Handling Interrupted Streams

Network hiccups on mobile connections occasionally caused broken SSE sockets. Implemented an exponential-backoff stream reconnect buffer with checksum message replay.

Micro-Animations & Performance

Emotive avatar states required smooth transitions without locking the main thread. Utilized CSS hardware-accelerated transforms rather than JavaScript layout recalculations.

CHAPTER 04

Impact & Results

Teman Kos attained over 1,200 independent active user sessions within its first month of beta testing, achieving an average interaction duration of 4.2 minutes and a 98/100 Lighthouse performance score across mobile devices.