Geoffrey Litt created a personalized AI assistant using a simple, yet effective, setup. Leveraging a single SQLite database table to store personal data and instructions, the assistant uses cron jobs to trigger automated tasks. These tasks include summarizing articles from his RSS feed, generating to-do lists, and drafting emails. Litt's approach prioritizes hackability and customizability, allowing him to easily modify and extend the assistant's functionality according to his specific needs, rather than relying on a complex, pre-built system. The system relies heavily on LLMs like GPT-4, which interact with the structured data in the SQLite table to generate useful outputs.
Geoffrey Litt describes a minimalist approach to building a personalized AI assistant, foregoing complex vector databases and intricate application architectures in favor of a streamlined system centered around a single SQLite table and a few strategically scheduled cron jobs. He terms this creation "Cron AI."
The system's core is an SQLite table that houses all the data the AI interacts with. This table includes columns for a unique identifier, the content itself (which can be anything from code snippets to meeting notes to journal entries), the date the entry was added, and a generated embedding vector. These embeddings, crucial for semantic search, are created using OpenAI's embedding API and stored directly within the SQLite table.
Instead of relying on a constantly running service, Litt utilizes cron jobs to periodically execute key tasks that keep the AI assistant functional. One cron job is responsible for pulling new data from various sources. Litt provides examples such as syncing code from GitHub repositories, importing meeting transcripts from a specified directory, and incorporating journal entries. This data is then inserted into the SQLite table. Another cron job calculates the embedding vectors for newly added content using the OpenAI API and updates the corresponding rows in the table. This periodic updating keeps the AI’s knowledge base fresh.
When the user wants to interact with the AI, they employ a simple Python script. This script takes a natural language query as input, calculates its embedding vector, and then performs a similarity search against the embeddings stored in the SQLite table. Cosine similarity is used to measure the relatedness between the query and the existing data. The most relevant entries from the SQLite table, based on the similarity scores, are then returned to the user, effectively providing the AI with a contextually relevant knowledge base for answering questions or performing tasks.
Litt emphasizes the hackable nature of this setup. The simplicity of the architecture, relying on readily available tools like SQLite and cron, allows for easy customization and extension. Users can easily modify the data sources, the types of data ingested, and the ways the AI responds to queries. He also highlights the privacy benefits, as all data remains local and avoids reliance on third-party services beyond the OpenAI embedding API. While acknowledging the limitations compared to more sophisticated AI assistants, Litt argues that this minimalist approach offers a practical and accessible entry point for individuals seeking a personalized, private, and controllable AI tool.
Summary of Comments ( 64 )
https://news.ycombinator.com/item?id=43681287
Hacker News users generally praised the simplicity and hackability of the AI assistant described in the article. Several commenters appreciated the "dogfooding" aspect, with the author using their own creation for real tasks. Some discussed potential improvements and extensions, like using alternative databases or incorporating more sophisticated NLP techniques. A few expressed skepticism about the long-term viability of such a simple system, particularly for complex tasks. The overall sentiment, however, leaned towards admiration for the project's pragmatic approach and the author's willingness to share their work. Several users saw it as a refreshing alternative to overly complex AI solutions.
The Hacker News post titled "A hackable AI assistant using a single SQLite table and a handful of cron jobs" has generated a substantial discussion with several compelling comments.
Many commenters express admiration for the project's simplicity and hackability. They appreciate the author's focus on using readily available tools and avoiding complex dependencies. Several users praise the transparency and control afforded by this approach, contrasting it with the "black box" nature of many commercial AI solutions. The use of SQLite and cron jobs is seen as a refreshing return to basics, empowering users to understand and modify the system to their specific needs.
A recurring theme in the comments is the potential for customization and extensibility. Commenters brainstorm various ways to adapt the system, such as integrating it with different data sources, adding specialized functionalities, or tweaking the prompting mechanisms. Some suggest using alternative databases or scheduling systems while maintaining the core philosophy of simplicity.
Some commenters discuss the limitations of the current implementation, particularly regarding scalability and complex reasoning tasks. While acknowledging these constraints, they often frame them as trade-offs in favor of transparency and control. The discussion also touches on the ethical implications of AI assistants, with some users expressing concerns about potential biases and misuse.
Several commenters share their own experiences with building similar systems or express their intention to experiment with the author's approach. This highlights the inspiring nature of the project and its potential to foster a community of like-minded developers. The discussion also includes technical details and suggestions for improvement, showcasing the collaborative spirit of the Hacker News community.
Some users raise questions about specific aspects of the implementation, such as data storage formats, error handling, and security considerations. These questions often lead to insightful discussions and clarifications, further enriching the overall conversation. The comments section also includes links to related projects and resources, demonstrating the interconnectedness of the open-source community.