Connecting the Last Piece
In Part 1 I got my Notion pages and Todoist tasks into Postgres. Part 2 is the piece everyone pictures when they hear “AI assistant”: you ask a question, you get an answer.
The setup is simple. A question comes in, retrieval pulls the closest notes and the open tasks, and all of it goes to Claude with one instruction: answer only from what you were given.
A quick note on the examples. The questions I actually tested are about my own plans, so everything below uses a made-up trip to Lisbon. The failures are the real ones I hit. Only the data is invented.
The First Answer
I asked it: “what tasks do I have for the LX trip, and what have I noted about it?” (LX is just how I write Lisbon.)

It listed the tasks correctly. Then it told me my note on the trip had almost no detail and suggested I expand it. I had written a full page: where to stay, how to get to Sintra, what to book early.
The Model Wasn’t the Problem
Claude answered from what it was handed. What it was handed was the wrong five chunks of my notes. The page I wrote was sitting in the database and search never returned it.
That’s a retrieval problem, not an answer problem, and it’s easy to miss because the answer sounds completely sure of itself. I only caught it because I knew what was in my notes.
The reason is how the search works. It compares the meaning of the question to the meaning of each chunk. My question mixed three things: tasks, notes, and a nickname. My notes say “Lisbon” and never “LX”. So the question landed closer to generic travel and planning notes than to the page that actually answered it. With 95 pages in the workspace and only five slots, the near misses crowded out the one that mattered.

The Fix: Rewrite the Question Before Searching
Before anything gets searched, a small, cheap Claude call rewrites the question into search words. It drops the filler, drops the “tasks” part since this search only covers notes, spells out nicknames, and adds a few related terms. My question comes out as something like “LX Lisbon trip planning where to stay Sintra transport restaurants”.
Three decisions in there:
- The rewritten query is only used for the notes search. Tasks still come from a plain database query, and the original question still goes to Claude for the final answer.
- If the rewrite fails or comes back empty, it falls back to the original question. That way the step can only help, never break retrieval.
- It uses a small model. It’s a rewording job, not a thinking job.
The fallback is the part I’d copy into any project:
try:
message = await client.messages.create(
model=settings.rewrite_model,
max_tokens=100,
system=REWRITE_PROMPT,
messages=[{"role": "user", "content": question}],
)
except anthropic.APIError:
return question
text = message.content[0].text.strip()
return text or question
With that in place, the page I wrote came back and the answer used it.
Better, but Still Wrong
Fixing retrieval exposed the next set of problems. The answer now had the right notes and was still wrong in three ways:
- It miscounted. It said “three tasks” and listed four. Models are unreliable at counting, so I stopped asking. The rule now is to just list them.
- It didn’t know what day it was. Tasks due weeks earlier were listed like they were coming up. The most useful thing this assistant can say is “this is 23 days late”, and it never said it. The fix was one line to put today’s date into the context, plus a rule to call out overdue tasks.
- It stated guesses as facts. It linked a task to the trip because that seemed plausible, not because anything said so. The rule now: only connect a task to a topic if the title or a note says so, and if it’s a guess, say it’s a guess.
Three lines in the system prompt and one line of code. Same question again:

What I Took From It
When an answer is wrong, check what the model was handed before blaming the model. I would have spent a long time tweaking the prompt if I hadn’t looked at what search actually returned.
Each fix exposed the next problem. That’s normal. You can’t see the date problem while the wrong notes are still coming back.
And I only caught any of this because I read every answer against what I knew was true. A personal assistant over my own data is a good place to practice that, since I’m the one person who knows the right answer.
What’s Next
Weaver runs behind a small API now, so I can ask it things without a script. The next step is where it stops waiting to be asked: a scheduled job that looks at overdue tasks, finds the notes that relate to them, decides whether it’s worth bothering me, and sends an email.
The deciding part is the hard one. The overdue tasks it just flagged are the first test.
More on that in the next post.