JSON data is not returned correctly from AI Agent

Hi everyone, I have been playing around with an API which gives me 261 entries.

I have stringify these json objects and placed them inside my supabase vector database looking like this

The content entries for every data inside this vector database is something like this

Propiedad ID: 1745 Título: Lote en La Deseada Country Tipo de Propiedad: Terreno Operación: Venta País: Argentina Provincia: Cordoba Localidad: La Calera Barrio: La Deseada Country Calle: Barrio La Deseada Country Denominación: L5 M1 Superficie Total: 1203 m² Superficie Cubierta: 0 m² Precio: U$S 80.000 Precio Numérico: 80000 Moneda: D Precio Visible: No Dormitorios: No especificado Baños: No especificado Plantas: 0 Ambientes: No especificado Garage: No Apto Crédito: No Publicada: No Destacada: No Oportunidad: No Agua Corriente: No Gas Natural: No Fecha de Ingreso: 16/01/2025 Fecha de Actualización: 20/01/2025 Antigüedad: 0 años Estado: No especificado Estilo: No especificado Video: No disponible Tour Virtual: No disponible Coordenadas: -31.3552698, -64.3225415 Imagen: https://mywebsite/serverdata/443/Fotos/Fi174500.443

I use this because I summarize the json with specifics of the property or land that its sold to let the AI find it better and do a better search.

Now, the problem is that if I ask a question regarding locations, for example

Give me all lands within X location

The Ai Agent will give me 4 or 5 but not the entire data

Im questioning myself if this is done to not limit the context or token windows on responses, but I need all the data to be able to be recovered.

Also , I dont know if this is the best way of storing data for semantic search with an AI Agent

This is my workflow





Can anyone guide me if im doing this the right way?? because I need my agent to return everything that relates to a location term and not only 4 or 5 objects, a response will be like this

But as I said it will not bring the full data regarding this place that I asked, only 5 - 8 max

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Kurcano

When retrieving vector store documents, the default limit is 4 which might be why you’re seeing limited results. You can try increase this number quite a bit since your documents returned are quite small.

However judging from your query, semantic/similarity search might not be what you want. “Give me all lands from X location” sounds to me is better served with an SQL query instead and I’ve seen in a few cases much preferred for inventory management type of agents.

Consider using the Supabase tool instead - Supabase node documentation | n8n Docs. This tool allows the agent to make a SQL query to your supabase table directly which saves you the extra work to convert it to a vector store.