Client work
Psychology Blossom chatbot
A chatbot that answers questions and matches clients with a therapist
A chatbot for Psychology Blossom, a Singapore counselling practice, that answers clients' questions at any hour and helps them find a suitable therapist.
Result
Live on psychologyblossom.com
Role
Freelance developer
Period
Nov 2024 – Jan 2025
Stack
Python, OpenAI API, FAISS, Google Cloud Platform, JavaScript, Streamlit
In short
Psychology Blossom is a counselling practice in Singapore. Visitors to its website ask the same questions again and again, and new clients often need help choosing a therapist. I built a chatbot that answers their questions at any hour, narrows down the therapists who suit them, and points them to the team to book.
"Jin Thau was a pleasure to work with. He understood our requirements perfectly and delivered a solution that exceeded our expectations."
Anna Nikitenko, Analytics Head, Psychology Blossom

How it works
A chatbot for a counselling practice needs to give accurate information. A wrong price, or a therapist who doesn't exist, would mislead clients and reflect badly on the practice.
LLMs are good at understanding loosely worded input, but less reliable when exact answers are needed. They can also be given tools: pieces of code they can choose to run, such as a search, and whose results they read before replying.
In this chatbot, the LLM's main job is to turn what people type into fixed values, such as a category, a language, a price range or a name. Regular code inside the tools handles everything that needs to be exact, from searching the FAQ to saving preferences and filtering therapists. The LLM then writes its reply based on what the code returned, which keeps hallucination to a minimum.
The work is also split between two models. A stronger main model handles the conversation and decides which tool to use. The smaller translation steps go to a cheaper model, which is faster and over 15 times cheaper per token. Splitting work between large and small models like this has since become a common design in AI products.
Architecture
The chatbot's tools. Hover or tap one to see how a message flows through it.
- Visitor→Main assistant“any therapists who speak chinese?”
- Main assistant→CodebaseFind a therapist
- Codebase→HelperRewrite the latest preference to stand alone
- Helper→Codebase“Wants a therapist who speaks Chinese”
- Codebase→HelperWhich category: gender, language, age group, speciality or price?
- Helper→Codebase
language - Codebase→HelperFill in the language
- Helper→Codebase
language = "Chinese" - Codebase: ✗ Check against the real options: “Chinese” isn't one
- Codebase→HelperNot an option. Pick from the real ones
- Helper→Codebase
language = "Mandarin" - Codebase: Save the preference, then filter therapists by every saved preference
- Codebase→Main assistant
[matching therapists] - Main assistant→VisitorLists the therapists who speak Mandarin
chips fixed values the code acts on uses stored dataGrey arrows: repliesKeeping answers accurate
- The main model doesn't pass values into tools. It only decides which tool to call. Each tool reads the conversation itself and does its own small translation step, so the main model can't pass in a wrong value.
- Preferences are stored in code. Each preference is saved outside the LLM, and therapists are filtered by all of them together. This means the chatbot won't forget a preference partway through the conversation, and can only suggest therapists who exist.
- Every value is checked. If an LLM produces something that isn't a valid option, the code rejects it and returns the closest valid options, and the LLM tries again.
- The FAQ search matches questions, not answers. Only the FAQ's questions are embedded, and each one links to its answer by ID. This keeps long answers from affecting the search, lets the team edit an answer without re-embedding anything, and returns nothing if no question is similar enough.
- It stays on topic. It declines questions unrelated to the practice, and leaves bookings to the team.
Implementation notes
FAQ questions are embedded with text-embedding-3-small into a FAISS inner-product index. On startup it syncs with the FAQ file, embedding only new questions and removing deleted ones. Preferences are combined with set intersections, names and options are matched by Levenshtein distance, and the cost of every model call is tracked per model. The code is on GitHub.