Comment by visarga

Comment by visarga 2 days ago

4 replies

> I have struggled to get any of the RAG approaches to handle this effectively.

You need to annotate your text chunks. For example you can use a LLM to look over the chunks and their dates and generate metadata like summary or entities. When you run embedding the combination data+metadata will work better than data alone.

The problem with RAG is that it only sees the surface level, for example "10+10" will not embed close to "20" because RAG does not execute the meaning of the text, it only represents the surface form. Thus using LLM to extract that meaning prior to embedding is a good move.

Make the implicit explicit. Circulate information across chunks prior to embedding. Treat text like code, embed <text inputs + LLM outputs> not text alone. The LLM is how you "execute" text to get its implicit meaning.

ffsm8 2 days ago

Hmm, I'm trying to contextualize your insight with the example that was given.

That approach sounds great for a lot of usecases, but wouldn't it still struggle with the given example of the age changing over the years?

How old is x? -> 10

Two years later:

How old is x? -> 12

  • sprobertson 2 days ago

    As a simplified example:

    (memory) [2023-07-01] My daughter is 10

    (memory) [2024-05-30] My daughter turned 11 today!

    System prompt: Today is 2025-08-21

    User prompt: How old is my daughter?

    The vector DB does the work of fetching the daughter-age-related memories, your system decides (perhaps with another LLM) if the question needs time-based sorting or something else.

    • potsandpans a day ago

      Still new to the rag space, but there op had an additional callout, "and [later] i call her by her name"

      Is it capable to go from `[name] -> [my daughter as a concept] -> age` ?