Sparse database data is hurting a RAG agent’s answers

A is being built with Qwen2.5 running through Ollama. The goal is for the model to work with a risk register and answer questions about risks, incidents, and mitigations using simple or complex SQL queries. The main problem is that the database is very sparse.

Some tables are empty, and many columns have missing values, so query results often lack useful context. Because of that, the agent receives weak results and gives inefficient answers. was added by chunking each table row by row and creating , but more advanced search methods such as or RRF are not in place yet.

The desired outcome is for the agent to ignore missing or null values and interact with the database more efficiently.

Key points

  • The setup uses Qwen2.5 through Ollama in a .
  • The agent must answer from a risk register about risks, incidents, and mitigations.
  • The database has empty tables and many missing column values, which weakens context.
  • has been added with row-level , but advanced methods are not yet used.
  • The agent needs a way to ignore missing or null values and query the database more efficiently.
Read original