Overview
TemuCita is an Indonesian mental-health community where people find sessions, support, and each other. Cita is the AI companion I built for it: a chat where members can talk about what they are going through, at any time, in Bahasa Indonesia. It opens with “ini adalah ruang aman untuk berbicara” (this is a safe space to talk).
I built it as a volunteer, on my own, from an empty repository to a feature that now runs inside TemuCita’s platform.
The problem
The community runs sessions and events, but people don’t only need someone to talk to when a session is scheduled. Sometimes it’s 2am and there is no one to message.
A normal chatbot is not a good fit for this, for three reasons. First, it answers from whatever it learned in training, not from material the community trusts, and in a mental-health setting wrong advice can do real harm. Second, it forgets, so every conversation starts from zero and the person has to explain themselves again. Third, it is a dead end: it talks, but never points the person to a real person or event that could help.
So I designed Cita around those three problems. It answers from documents the community curates, it remembers, and it suggests a community event when one actually fits.
Building it
Cita is one Next.js app on PostgreSQL with pgvector, using Prisma as the ORM and Clerk for sign-in and admin access.
- Grounded answers. Admins upload PDFs or text through a dashboard that acts as a source-of-truth document.
- Memory. When a conversation gets long, the oldest fifteen messages are condensed into a summary of about 200 words, so a conversation can go on for weeks without overflowing the context window.
- User profile. In the background, Cita builds a small profile for each user: a one-line
summary and a list of interests like
["anxiety", "sleep issues", "mindfulness"]. I kept it small on purpose, because I didn’t want to store a detailed record of someone’s mental state. - Event suggestions. On each message, the app also searches the community’s events using the message and the profile. This search is stricter, so Cita only suggests an event when it really fits, because a bad suggestion at a vulnerable moment feels like being sold to.
I considered a multi-agent framework like LangGraph, but decided against it. The flow is simple and linear (message in, retrieve, call the model, reply), so a graph would only add more parts that can fail and more latency. The context for each turn is gathered in normal code instead, where it is easier to test.
The first version ran on Google Cloud. It now runs on AWS, with Amazon Bedrock for both the chat model and the embeddings, and S3 for the documents. The move was easier than expected because I built the embeddings around a fixed 3072-dimension size from the start. I picked a new embedding model with the same size, so the database column, the index, and the stored vectors didn’t need to change.
Outcome
Cita is live inside TemuCita’s platform, so members use the same login and don’t have to go to a separate site. Admins can upload a new document and Cita can use it right away, without a deploy or a developer.
A lot of positive feedbacks about the page, everyone liked how it looks and enjoyed their interaction with the AI companion.
What I learned
Since Cita is for people who might be struggling, a lot of the work was deciding what not to build: a strict retrieval threshold, a small user profile, and no multi-agent framework. These simple choices did more for the quality of Cita’s answers than a more complex setup would have.
I also learned to choose the embedding size carefully and early. It looked like a small decision at first, but it is the reason switching cloud providers took little effort instead of a rewrite.