Live data from Hacker News

A hackable AI assistant using a single SQLite table and a handful of cron jobs

geoffreylitt.com

41–50 of 183 posts

Re: A hackable AI assistant using a single SQLite table and a handful of cron jobs

#41
So… I have a number of questions:

1. How did he tell Claude to “update” based on the notebook entries?

2. Won’t he eventually ran out of context window?

3. Won’t this be expensive when using hosted solutions? For just personal hacking, why not simply use ollama + your favorite model?

4. If one were to build this locally, can Vector DB similarity search or a hybrid combined with fulltext search be used to achieve this?

I can totally imagine using pgai for the notebook logs feature and local ollama + deepseek for the inference.

The email idea mentioned by other commenters is brilliant. But I don’t think you need a new mailbox, just pull from Gmail and grep if sender and receiver is yourself (aka the self tag).

Thank you for sharing, OP’s project is something I have been thinking for a few months now.

Re: A hackable AI assistant using a single SQLite table and a handful of cron jobs

#42
post #41

So… I have a number of questions: 1. How did he tell Claude to “update” based on the notebook entries? 2. Won’t he eventually ran out of context window? 3. Won’t this be expensive when using hosted solutions? For just personal hacking, why not simply use ollama + your favorite model? 4. If one were to build this locally, can Vector DB similarity search or a hybrid combined with fulltext search be used to achieve this…

> Won’t he eventually ran out of context window?

The "memories" table has a date column which is used to record the data when the information is relevant. The prompt can then be fed just information for today and the next few days - which will always be tiny.

It's possible to save "memories" that are always included in the prompt, but even those will add up to not a lot of tokens over time.

> Won’t this be expensive when using hosted solutions?

You may be under-estimating how absurdly cheap hosted LLMs are these days. Most prompts against most models cost a fraction of a single cent, even for tens of thousands of tokens. Play around with my LLM pricing calculator for an illustration of that: https://tools.simonwillison.net/llm-prices

> If one were to build this locally, can Vector DB similarity search or a hybrid combined with fulltext search be used to achieve this?

Geoffrey's design is so simple it doesn't even need search - all it does is dump in context that's been stamped with a date, and there are so few tokens there's no need for FTS or vector search. If you wanted to build something more sophisticated you could absolutely use those. SQLite has surprisingly capable FTS built in and there are extensions like https://github.com/asg017/sqlite-vec for doing things with vectors.

Re: A hackable AI assistant using a single SQLite table and a handful of cron jobs

#43
hah! this is great. I built something similar using mcp.run and a task

- https://docs.mcp.run/tasks/tutorials/telegram-bot

for memories (still not shown in this tutorial) I have created a pantry [0] and a servlet for it [1] and I modified the prompt so that it would first check if a conversation existed with the given chat id, and store the result there.

The cool thing is that you can add any servlets on the registry and make your bot as capable as you want.

[0] https://getpantry.cloud/ [1] https://www.mcp.run/evacchi/pantry

Disclaimer: I work at Dylibso :o)

Re: A hackable AI assistant using a single SQLite table and a handful of cron jobs

#44
post #40
post #28

This is probably naive and looking forward to a correction; isn't sending your info to Claude's API (or really any "AI API") is a violation of your safeguarded privacy data?

Only if you don't believe the AI vendors when they promise that they won't train on your data. (Or you don't trust them not to have security breaches that grant attackers access to logged data, which remains a genuine thread, albeit one that's true of any other cloud service.)

I have an AI/bridge to sell you.

Re: A hackable AI assistant using a single SQLite table and a handful of cron jobs

#45
post #40

Earlier quoted context omitted.

Only if you don't believe the AI vendors when they promise that they won't train on your data. (Or you don't trust them not to have security breaches that grant attackers access to logged data, which remains a genuine thread, albeit one that's true of any other cloud service.)

I have an AI/bridge to sell you.

Believing vendors who tell you "we won't train on your data" is a huge competitive advantage right now.

Re: A hackable AI assistant using a single SQLite table and a handful of cron jobs

#46
post #42
post #41

So… I have a number of questions: 1. How did he tell Claude to “update” based on the notebook entries? 2. Won’t he eventually ran out of context window? 3. Won’t this be expensive when using hosted solutions? For just personal hacking, why not simply use ollama + your favorite model? 4. If one were to build this locally, can Vector DB similarity search or a hybrid combined with fulltext search be used to achieve this…

> Won’t he eventually ran out of context window? The "memories" table has a date column which is used to record the data when the information is relevant. The prompt can then be fed just information for today and the next few days - which will always be tiny. It's possible to save "memories" that are always included in the prompt, but even those will add up to not a lot of tokens over time. > Won’t this be expensive…

SQLite + sqlite-vec/DuckDB for small agents is going to be a very powerful combination.

Do we even need to think of these as agents, or will the agentic frameworks move towrads being a call_llm() sql function?

Re: A hackable AI assistant using a single SQLite table and a handful of cron jobs

#47
post #15

This is fun! I think this sort of tooling is going to be very fertile ground for hackers over the next few years. Large swathes of the stack is commoditized OSS plumbing, and hosted inference is already cheap and easy. There are obvious security issues with plugging an agent into your email and calendar, but I think many will find it preferable to control the whole stack rather than ceding control to Apple or Google.

So we can just send him self deleting emails to mine crypto for us? How convienent.

"There are obivious security issues with plugging and agent into your email..." Isn't this how North Korea makes all their crypto happen?

Re: A hackable AI assistant using a single SQLite table and a handful of cron jobs

#49
I argue that this kind of tools are fun to play but in the end is it really helpful? I start my day like every day and on work I just check the calendar. My private calendar has all Information i need. Where is the gap where an Assistent makes sense and where we are just complicating our lives?
Post reply on HN