Ask my portfolio
EVOLVINGThe problem
A visitor doesn’t have time to read all my READMEs to find out what I’ve done. They have a specific question and want a specific answer, without digging.
What I’m building
An assistant that answers questions about my projects relying only on the READMEs of my public repositories and on the pages of this site. Every answer cites the passages it used, with a link to their source, so anyone can check it. And when the answer is not in the documents, it says so instead of making something up.
The demo
You ask a question in French or English, for example “Why is Strasbourg not covered by the estimator?”. The answer shows up with its sources, marked by a small number in the text. An off-topic question, like the capital of Australia, shows the “I don’t know”.
Or try:
- off-topic: to see the assistant decline to answer
Question
AnswerNot in the documents
Sources
An AI assistant that only reads a small set of documents. It can be wrong or miss a passage: check with the sources.
How it works
- The corpus. The READMEs of my public repositories and the pages of this site: 11 documents, split into 158 passages of at most 1,000 characters, which keep their section title. My private repositories are not in it, since the answers are public.
- The index. Each passage becomes a vector through a small multilingual model (multilingual-e5-small), computed on my computer and then copied to the server. The server only turns the question into a vector, in a few milliseconds. I chose it because it reads a whole passage (512 tokens), understands French and English, is built for search, and fits in 830 MB of RAM.
- The search. The 15 passages closest to the question are given to the model. Fifteen and not five: within one document the scores are so similar that the right passage often only comes eighth or later.
- The answer. A language model receives an instruction: answer only with these passages, cite their numbers, and say “I don’t know” otherwise.
- The sources. The numbers in the text point to the list of sources, with a link to the original README or page.
How I measured it
A set of 32 questions written by hand: 22 whose answer is in the corpus, 10 whose answer is not. Among them, traps: a price that no document gives, a question in English about a document in French, an instruction slipped into the question. Two scores: is the right passage among those given to the model? does the answer say only what the passages say? The second is graded by a language model, consulted three times, after calibrating it on false answers I had made up.
Three very different language models give similar results, within a question or two. What changed the results was the number of passages given to the model, not the model that writes the answer.
Under the hood
The panel above reads the model, the number of passages in the index and its version live from the API. The cost (about $0.0005 per question) and the latency (1.2 s on average) come from my 32 evaluation questions; the latency of your last question replaces it as soon as you ask one. The prompt is a single instruction: answer only with the passages provided, cite their numbers, otherwise say “I don’t know”.
- Model
- Claude Haiku 5.5 (via OpenRouter)
- Cost / request
- ≈ $0.0005
- Latency
- ≈ 1.2 s
- Prompt
- only the passages provided, sources cited, otherwise “I don't know”
Architecture
- Browser
- Astro site (Vercel)
- Site route (adds the key)
- rag.tatane.me (Caddy, HTTPS)
- FastAPI (Docker)
- Index + model (OpenRouter)
- Hosting
- Pages and two server routes on Vercel. The API runs in a Docker container on the same Ubuntu VPS as the estimator, behind the same Caddy: only Caddy is reachable from the Internet. The small model that turns questions into vectors runs in that container; the answer is written by a language model through OpenRouter.
- What is exposed
- Two routes on the site. The API only accepts calls with a key, kept on the site's server: never in the browser. The model provider's key never leaves the API's server.
- Data and privacy
- A public corpus: the READMEs of my public repositories and the pages of this site, 158 passages. Questions are neither stored nor logged, but they are sent to the model provider to write the answer: do not put anything personal in them.
- Safeguards
- API key, 10 questions per minute per visitor, 1,000 per day in total, questions limited to 500 characters, requests from other sites refused, spending cap at the provider, container without root and with limited memory. If the answer is not in the documents, the assistant must say so.
- Real measurements
- Evaluation on 32 questions, 10 of them with no answer in the corpus: the right passage is found 22 times out of 22, and every answer given is judged faithful to its sources (by a grading model, which is Haiku itself: see the limits). It says “I don't know” correctly 9 times out of 10 and wrongly declines 1 time out of 22. Cost and latency: those shown above, measured on these questions. The set is small and I wrote it myself: read it with caution.
The limits
The corpus caps the quality. A one-sentence README doesn’t allow good answers: the one for Just-One-More-Ep is only found by the question “which app tracks the series I watch?” with 15 passages, and one of the three models tested still declines to answer it. Each question is independent: the assistant has no memory of the conversation. And faithfulness is graded by a model, so with some noise, and by the same one that answers when it is Haiku.
What I take from it
- My first score flattered me. I counted the right file; checking the right passage, 95% became 82% with 5 passages. That is what led me to give it 15.
- A model that thinks by default is slower. Haiku spent half of its tokens reasoning: on the two questions I measured, answers about twice as slow and 40 to 95% more expensive. I turned it off, without being able to measure any loss of quality on my questions.
- The choice of embeddings model came down to detail questions. I took
multilingual-e5-smallbecause it reads a whole passage: a lighter model, MiniLM, cuts 117 of my 158 passages at 128 tokens. On my everyday questions the two are equal (MiniLM even has a slight edge), so I could not decide. I then wrote eight detail questions, chosen before looking at any results: e5-small finds the right passage 8 times out of 8, MiniLM 4 times out of 8. The limit: eight questions that I wrote, to put MiniLM in difficulty. A third, simpler model does worse in both cases. - An AI grader gets it wrong too. The first one called faithful answers unfaithful. I calibrated it on cases where I knew the right answer before trusting it.