ChattyChat — a character chat with memory, built in Next.js by Niko MinadzeChattyChat — a character chat with memory, built in Next.js by Niko Minadze

ChattyChat — a character chat with memory, built in Next.js

Niko Minadze

Niko Minadze

A character with something to remember

How much personality can a scripted conversation have?
I built ChattyChat to explore that question through Lena, a fictional character with a lightly flirtatious voice, a sense of humour and a few things she can remember about the person chatting with her. Introduce yourself, mention something you like, or ask about her day, and those details can shape what comes next.
The project combines a Next.js and React interface with a JavaScript conversation engine. Replies come from authored text, templates and rules. No language model generates the conversation.
ChattyChat in use: a scripted character conversation built with Next.js, React and JavaScript.

The challenge

A list of canned answers gets repetitive quickly. The interesting work was making a small, authored character stay consistent across a conversation: remembering a name, recognising a repeated question, changing a reply without changing her personality, and falling back gracefully when a message falls outside the rules.
I also wanted visitors to enjoy the chat without needing to understand its implementation. The technical explanation lives in an optional panel that starts closed.

What I built

A chat interface with character. A plum-and-rose palette, message bubbles, typing feedback, quick prompts and inline photos give the conversation its own tone.
Session memory. The engine can capture and recall details such as a name, city and preferences, alongside the current topic and previous interactions.
Stateful reply selection. Phrase matching, rule priority, response banks and repeat handling work together to choose the next reply.
An optional inspector. Visitors can open the panel to see remembered details and enable labels showing which rule produced a response.
A repeatable conversation engine. Identical input and conversation state produce the same engine output, making a sequence practical to replay and check.
Lena remembers Niko's introduction and answers a follow-up question in character. The inspector stays closed during ordinary conversation.
Lena remembers Niko's introduction and answers a follow-up question in character. The inspector stays closed during ordinary conversation.

How it works

The engine keeps the conversation state separate from the React interface. It evaluates an incoming message, selects or constructs a reply, and returns the updated state. Persona facts and response banks live separately from the matching logic, so the character's writing can evolve without rewriting the UI.
The current engine contains 164 keyword rules, alongside fact handling, small commands and fallback responses. Reply selection runs in the browser; it does not send chat messages to a model service. Hosting still serves the application and its bundled images.
Memory lasts for the current page session and clears on reset or reload. It is explicit state, with deliberately limited extraction rules.

Result and scope

The result is a working character-chat prototype with an inspectable connection between what a visitor says, what the character remembers and how she answers. Direct engine checks covered name and preference recall, arithmetic, unchanged input state and repeatable outputs across the same conversation sequence.
It demonstrates interactive frontend development, state management and the integration of conversation logic with UI feedback. Its English-language conversation remains bounded by authored rules and heuristic matching; the project is an experiment in scripted interaction.
Like this project

Posted Sep 21, 2026

I built a playful character chat with authored replies, session memory and a rule inspector using Next.js, React and JavaScript.