DEV Community

Ryan
Ryan

Posted on

dwriter: An AI-powered terminal tool that helps you record and reflect.

Gemma 4 Challenge: Build With Gemma 4 Submission

This is a submission for the Gemma 4 Challenge: Build with Gemma 4

What I Built

dwriter is a minimalist, terminal-first productivity tool designed to solve "logging friction"—the gap between having a thought and capturing it. By combining a zero-latency capture system with a rich, AI-augmented reflection layer, it transforms a standard developer journal into a living, private knowledge base. Jot down your thoughts, accomplishments, observations, and tasks, and have dwriter (powered by Gemma 4) help you not only recall, but reflect.

  • Designed for the a diverse workflow: dwriter lives where you work. It features an interactive Terminal User Interface (TUI) and a "headless" mode that grantees a zero-friction capture system that allows for instant logging without leaving the command line.
  • The Closed Learning Loop: Unlike passive journals, dwriter proactively learns from you. It automatically extracts durable facts (preferences, recurring goals, and hard constraints) to build a persistent graph of your professional life.
  • Local-First Engineering: Privacy is a core feature, not an afterthought. Using a Git-backed sync engine with Lamport clocks for conflict resolution and Obsidian integration, dwriter ensures your data remains yours,available offline, and seamlessly portable.

Explore 21 Creative Use Cases for dwriter

Screenshots

2nd-Brain's Insight Hub
Follow-Up Screen
Timer
Reports Screen

Code

dwriter (AI-Edition)

How I Used Gemma 4

To achieve the perfect balance between reasoning depth and terminal-speed performance, I implemented a Dual-Model AI Pipeline using the Gemma 4 family. This architecture is critical because it prevents the "intelligence latency" that typically plagues local LLM integrations. By decoupling interactive reasoning from background processing, dwriter remains responsive while building a deeply indexed personal knowledge base.

  1. Gemma 4 E4B (4B Dense) — The "Main Brain"
    The Main Brain is responsible for high-stakes reasoning and interactive synthesis. It powers the "2nd-Brain" chat and generates complex analytical reports like Weekly Retrospectives and Burnout Assessments.

    • The Agentic ReAct Loop: Instead of simple text completion, the E4B model operates via a Reason + Act (ReAct) pipeline. When you ask a question, it reasons about your intent, selects the appropriate tool (e.g., run_cypher, fetch_recent_commits, or search_facts), and synthesizes the raw data into a grounded, professional response.
    • Context Synthesis: Its higher reasoning density allows it to merge multiple streams of context—your journal, git history, and tasks—to identify subtle trends and provide data-driven advice.
  2. Gemma 4 E2B (2B Dense) — The "Daemon"
    The Daemon handles the high-frequency, structured extraction tasks that happen silently in the background. In a terminal environment, speed is a dealbreaker; the E2B model is optimized for near-instant execution.

    • The Closed Learning Loop: Every time you save an entry, the Daemon performs Fact Extraction and Semantic Auto-Tagging. It identifies "Durable Facts"—preferences, long-term goals, and recurring constraints—and projects them into the graph index.
    • Recursive Summarization: It works in the background to summarize long-term history, ensuring that your "2nd Brain" maintains a compressed yet accurate map of your progress without causing UI stutters or interrupting your flow.

To learn more, visit: The 2nd-Brain Guide

Technical Depth: Graph-Backed Intelligence

The true technical power of dwriter lies in how it manages data. Under the hood, the tool employs a sophisticated hybrid storage engine:

  • Hybrid Indexing: We use SQLite for relational data alongside LadybugDB (a property-graph index). This allows the Gemma 4 models to perform complex Cypher queries to find hidden relationships between seemingly unrelated thoughts.
  • Agentic Agency: The ReAct pipeline is not just a wrapper; it is a secure execution environment where the AI can query your local Git history and task list to provide answers grounded in reality, not hallucinations.

Local-First Privacy: By running this entire pipeline locally, dwriter ensures that your most sensitive thoughts never leave your machine. It is a "2nd Brain" that gains intelligence with every entry you write, while remaining 100% private and persistent.

Project author: Rhaeyyan

Top comments (0)