ProofChat search slow

I am testing ProofChat on a copy of my client’s DB, which is installed on FM Server on my laptop… so it’s local, no network. I have added three TOs and a small number of fields to the relationship graph, and pointed the necessary scripts (Configure DDL, etc) to them. It works, but it’s unbearably slow. The Work Orders table has 328,000 records. I have tagged about 6 fields with the LLM tag in the comments. Two of these fields are Status and State, both of which are indexed. I did a search for this:

show me all work orders in the state of IL with a status of scheduled

The SQL Query shows up as this:

SELECT “DuctsWorkOrders”.ROWID, “DuctsWorkOrders”.“WorkOrderID”, “DuctsWorkOrders”.“DateCompleted”, “DuctsWorkOrders”.“DateScheduled”, “DuctsWorkOrders”.“ServiceType”, “DuctsWorkOrders”.“State”, “DuctsWorkOrders”.“Status” FROM “DuctsWorkOrders” WHERE UPPER(“DuctsWorkOrders”.“State”) = UPPER(‘IL’) AND UPPER(“DuctsWorkOrders”.“Status”) = UPPER(‘Scheduled’)

It returned 27 records, which is correct, but it took nearly a full minute. That same search in FM is instantaneous. Is this normal?

Hi @markrube - great question, and what you’re seeing is normal for FileMaker’s SQL-based natural language querying, using OpenAI.

When you run a natural language query, FileMaker must:

  1. Collect your LLM-tagged schema (the fields you marked in the relationship graph)
  2. Package the schema + your natural language prompt
  3. Send that to OpenAI
  4. Wait for the OpenAI model to interpret your prompt
  5. Wait for the OpenAI model to generate an SQL SELECT statement
  6. Return that SQL to FileMaker
  7. Have FileMaker Server execute that SQL
  8. Return the result set to ProofChat

The delay you’re experiencing is coming almost entirely from steps 3-5.

I hope that clarifies the process for you.

Thanks Angelo, that makes sense. Unfortunately it makes me wonder how useful this feature is going to be.