DEV Community

Cover image for Today I Learned: An App to Capture Your Daily Learning from LLM Chats
Hiroyuki Kuromiya
Hiroyuki Kuromiya

Posted on • Edited on

Today I Learned: An App to Capture Your Daily Learning from LLM Chats

Introduction

I'm excited to introduce "Today I Learned" (TIL), an app I've developed to help you capture and reflect on your daily learning experiences.

My TIL app automatically summarizes "what you've learned today" from your chat history with Large Language Models (LLMs) and presents it in a user-friendly dashboard for easy review. To get a quick overview of how it works, check out this demo video:

The Journey Behind TIL

My journey as a full-time web engineer began in the spring of 2023. Prior to that, I spent a decade in academia, focusing on educational technology research. During that time, I developed learning support tools, including dashboards for students.
After transitioning to the tech industry, I was fascinated by the unique culture of software engineering. One aspect that particularly caught my attention was the concept of "Today I Learned" (TIL).

While daily reports are common in many professions, I noticed that engineers often shared not just what they did, but what they learned. Inspired by this, I started adding a "What I Learned Today" section to my own reports. Little did I know, I was participating in the broader TIL culture of the tech world.

Understanding TIL

The TIL concept dates back to around 2008, originating from a "today-i-learned" topic on Reddit. It gained traction in the software development community, with developers creating "til" repositories on GitHub to document their daily learnings in Markdown format. Josh Branchaud's repository played a significant role in popularizing this practice.

The essence of TIL is beautifully captured in Reddit's TIL topic description:

"TIL does not aim for in-depth and serious discussion about a subject, but rather is more interested in a pop-knowledge overview of some minutiae of a field."
In other words, TIL is about sharing those "aha!" moments and bite-sized learnings, regardless of how profound or trivial they might seem.

How the TIL App Works

Now, let me walk you through the technical aspects of the TIL app:

  • The app is built with NextJS and hosted on Vercel
  • Firestore serves as the knowledge storage backend
  • User authentication is handled by Firebase Authentication

For the crucial task of extracting knowledge from chat histories, I leveraged the OpenAI API. The core logic resides in the digest API file, where I use the following prompt to distill the user's learnings:

const completion = await openai.beta.chat.completions.parse({
 model: "gpt-4o-2024–08–06",
 messages: [
 {
 role: "system",
 content:
 "Extract what the user learned from the chat to the bot in 100 words. Provide the response in plain text without using any markdown formatting. Use the same language as the user's input for the summary.",
 },
 …messages,
 ],
 response_format: zodResponseFormat(Knowledge, "knowledge"),
});
Enter fullscreen mode Exit fullscreen mode

This two-stage LLM process might seem redundant, but using chat as the source of knowledge extraction offers a clear picture of what the user was seeking to learn.

Closing Thoughts: Why an English Interface?

You might notice that the TIL app's interface is entirely in English although I am Japanese. This decision stems from two factors:

  1. TIL culture originated in the United States, and I wanted to make the app accessible to a global audience.
  2. My academic experience taught me that, unfortunately, work published solely in Japanese often struggles to gain recognition on the global stage.

The source code is open and available on GitHub. Feel free to localize, self-host, or contribute to the project. I welcome any issues or pull requests you might have!

Today I Learned - AI-Powered Learning Assistant

Today I Learned is an AI-powered learning support tool that helps you record daily discoveries, interact with AI, and track your learning progress.

Features

  • Ask AI: Interact with an AI assistant to get answers on any topic.
  • Automatic Learning Summary: Summarize and organize your learnings from AI interactions.
  • Learning Dashboard: Visualize your daily learning progress and growth.
  • User Authentication: Secure sign-in with Google.

Technology Stack

  • Next.js: React framework for building the frontend and API routes.
  • Firebase: Authentication and Firestore database.
  • OpenAI: AI-powered chat functionality.
  • Tailwind CSS: Utility-first CSS framework for styling.
  • Chart.js: Creating interactive charts for the dashboard.

Getting Started

  1. Clone the repository:
git clone https://github.com/yourusername/today-i-learned.git cd today-i-learned
  1. Install dependencies:
npm install
  1. Set up environment variables: Create a .env.local file in the root directory and add the following variables:
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_firebase_project_id NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_firebase_messaging_sender_id NEXT_PUBLIC_FIREBASE_APP_ID=your_firebase_app_id OPENAI_API_KEY=your_openai_api_key
  1. Run the…

By embracing the TIL concept and leveraging the power of LLMs, this app aims to make your daily learning more tangible and reflective. I hope you find it useful in your own learning journey!

Top comments (0)