Oussama Essamadi

Publicaciones

Your notes are the best context: RAG over Notion and Obsidian

My Notion databases are structured, my Obsidian vault isn't. Retrieval works over both, as long as you don't treat them the same way.

Publicado

Tiempo de lectura

2 minutos

Artículo

Every model out there knows the internet, but none of them knows how I rated the last film I watched, or what I wrote about a project last week. And that’s exactly the gap retrieval fills, find what’s relevant in your own data, put it in front of the model, and let it answer from that.

Now, my data lives in two places, and they couldn’t be more different. Notion holds my databases, films and shows among them, with properties and relations running between them, and Obsidian holds my vault, Markdown notes, half-finished thoughts, and links between ideas. The easy mistake here is to index both of them the same way.

Structured: query, don’t embed

The usual RAG recipe turns everything into text, splits it into chunks, and embeds the chunks. Do that to a Notion database though, and you lose its best part. “Films I rated above 8 last year” isn’t a similarity search, it’s a filter on two properties, and Notion’s API answers it exactly.

So for databases, the model’s first job is to turn a question into a query, which database, which properties, which values. The rows come back as rows, with their relations, and only then go into the prompt, no vector gets anywhere near a rating or a date.

I already had a head start here too, no-tion, the tool I built last year to fill in my databases through a few forms, already talks to them through Notion’s API.

Unstructured: keep the shape you wrote

Notes are where embeddings actually earn their keep, but how you chunk matters more than which embedding model you pick. Split a note every 500 characters, and it loses its argument halfway through a sentence, split it by headings instead, and each chunk is a section you actually wrote as one idea.

There are also two things in an Obsidian note that are worth more than their text. The frontmatter is metadata, dates, tags, status, stuff you can filter on before searching anything, and the links are a graph, when a chunk matches, the notes it links to are often the exact context the answer needs.

The pattern that works ends up being the same for both, narrow things down with structure first (this database, these tags, this year), then search whatever text is left. Mixing keyword search with vector search helps too, since names, titles and code are exactly where embeddings are weakest.

And every answer cites where it came from, the page, the row or the note. If I can’t trace an answer, I can’t trust it, and the citation is also how I catch a bad retrieval before it costs me anything.

Siguiente

oLas 21 publicacionesoAl azaroInicio

ProyectosPublicaciones

Cargando la lista…

Cargando la lista…

Atajos de teclado

Búsqueda y comandos
Ctrl K⌘K
Cambiar entre claro y oscuro
T
Todos los proyectos
P
Todas las publicaciones
W
Buscar en la lista abierta
S
Inicio
H
Escribirme
C
Mostrar estos atajos
?
Cerrar lo que esté abierto
esc

Los atajos están activados.