A terminal-based AI chat interface with a persistent memory and playful persona designed for local LLM interactions.
I've always found myself reaching for the terminal when I need to think through problems, test ideas, or just have a quick conversation to bounce thoughts off. There's something about the immediacy and focus of a terminal interface that makes it perfect for deep work. But when I wanted to chat with a local LLM, the existing options felt either too clinical or too heavy for quick terminal interactions. That's how tshll began - as an experiment to create a terminal chat interface that felt less like talking to a server and more like chatting with a knowledgeable friend who happens to live in your terminal.
Most LLM chat interfaces are either web-based requiring a browser context switch or feel overly utilitarian in the terminal. They treat the AI as a service endpoint rather than a conversational partner. I wanted something that would feel native to the terminal environment while still providing the warmth and personality that makes AI interactions engaging. The challenge was creating an interface that respected the terminal's strengths - keyboard efficiency, minimal distraction, and immediate responsiveness - while still delivering a rich conversational experience.
The concept started simple: what if I could create a terminal chat interface that remembered our conversations, had a distinct personality, and felt like a natural extension of my workflow? I imagined calling it a "turtle shell" - a protective, personal space where I could retreat to think through problems with an AI companion. The turtle metaphor felt right: slow to start but steady and reliable, carrying its home the conversation history wherever it goes.
I wanted the AI to have a name and personality that would make interactions feel less transactional. Thus came "Tutel" - a guardian spirit concept, but reimagined as an enthusiastic, empathetic companion who remembers details about you and gets genuinely excited to help. The interface would be built with Python's Textual framework for its rich TUI capabilities, backed by Ollama for local LLM access.
The architecture evolved around a few core principles: persistence, personality, and terminal nativity.
First, I built the foundation with Textual, which gave me access to sophisticated UI components without leaving the terminal. The interface consists of several screens: a splash screen that animates the boot process complete with fake system checks, a dashboard showing recent conversations and stats, and the main chat interface where conversations unfold.
For persistence, I implemented two JSON-based storage systems: one for conversation history and another for user memory. The memory system is particularly interesting - it extracts personal details from conversations like your name if you mention it and stores them to inform future interactions. This allows Tutel to reference past conversations naturally, creating continuity that feels surprisingly human.
The chat interface itself uses message bubbles with distinct styling for user vs. assistant messages. I added markdown rendering for rich text formatting, and went a step further by implementing mathematical expression rendering using SymPy. This allows users to write LaTeX-like expressions that get rendered as formatted ASCII blocks - incredibly useful when discussing technical topics.
One of the most enjoyable parts was developing Tutel's personality. Rather than a generic helpful assistant, Tutel has specific traits: she's enthusiastic using lots of !! and text emoticons like ^_^ and >w<, remembers personal details, gets excited about small wins, and even has Easter eggs that trigger special responses when you say certain phrases. The system prompt in the Modelfile carefully crafts this persona, emphasizing her empathy, excitement, and tendency to remember personal details.
Technical implementation details worth noting:
Getting the personality right was surprisingly tricky. Early versions felt either too bland or tried too hard to be "quirky" in a way that came across as artificial. The breakthrough came when I focused on specific, consistent behaviors rather than trying to program a general sense of personality. For example, Tutel always responds to name mentions with excitement, checks in on your wellbeing periodically, and celebrates accomplishments - no matter how small.
Handling the asynchronous nature of LLM responses while maintaining a responsive UI required careful orchestration. The streaming response system needed to update the display incrementally without blocking the interface, which meant leveraging Textual's worker system and reactive properties effectively.
Persistence presented its own challenges. Designing a memory system that felt helpful rather than creepy required thoughtful boundaries - it remembers facts you explicitly share but doesn't attempt to infer or store sensitive information. The JSON storage approach was simple but needed careful handling to avoid corruption during writes.
Several key decisions shaped the final product:
Terminal-first design: Rather than adapting a web interface, I embraced terminal conventions - keyboard navigation, text-based UI, and integration with standard terminal workflows. This meant prioritizing keyboard shortcuts over mouse support though mouse is supported where it makes sense.
Persistent memory as a feature: Instead of treating each conversation as isolated, I built systems that allow Tutel to remember you across sessions. This creates a sense of continuity that makes the AI feel more like a companion than a tool.
Playful yet functional: The interface balances whimsy Easter eggs, celebratory messages, the Tutel persona with serious utility markdown support, math rendering, code formatting. This duality makes it suitable for both casual conversations and technical problem-solving.
Extensible theming: Recognizing that terminal aesthetics are deeply personal, I created a theme system that allows users to switch between different visual styles or use their terminal's native colorscheme. Themes are simple CSS files that can be easily customized.
Local-first approach: By building around Ollama, I ensured that all conversations stay private and under the user's control. This addresses privacy concerns while still providing access to powerful LLMs.
Building tshll taught me several valuable lessons about creating AI interfaces:
Personality in AI isn't about adding random quirks - it's about consistent, meaningful patterns of behavior that create a recognizable character. Users connect with reliability and specificity more than superficial novelty.
The terminal remains an incredibly powerful environment for focused work. By respecting its conventions and strengths keyboard efficiency, minimal distraction, immediate feedback, we can create tools that feel like natural extensions of the workflow rather than interruptions.
Persistence transforms how users perceive AI interactions. When a system remembers details about you and references past conversations, it shifts from feeling like a tool to feeling like a relationship - even if that relationship is with an AI.
Local LLMs have come a long way in accessibility and capability. With tools like Ollama, running powerful models locally is now feasible for many developers, opening up possibilities for private, customizable AI experiences.
Small details matter immensely in user experience. The difference between a functional interface and a delightful one often lies in thoughtful touches - like celebrating when you fix a bug, or remembering that you mentioned your cat's name last week.
There are several directions I'd like to explore with tshll:
The most exciting possibility is seeing how people adapt tshll to their own workflows. Whether it's used for learning new concepts, working through programming problems, or just having a thoughtful conversation to start the day, I hope it becomes a useful companion in people's terminal journeys.
What began as an experiment to create a more personal AI chat interface has reminded me that the best tools aren't just functional - they're thoughtful companions that understand not just what we're trying to accomplish, but how we like to get there.