query_memories_with_sql
Run a read-only SQL query against the memory database.
Use this when the user wants exact counts, aggregates, or table-level facts
that a semantic search cannot give. Do not use it to change data: SELECT and
WITH statements only.
Read-only. Access control is applied by the server, so rows outside the
caller's permissions never appear. A LIMIT and a statement timeout are
applied automatically.
Args:
sql: A SELECT or WITH statement. `describe_memory_schema` returns the
table and column names to write it against.
max_rows: Automatic LIMIT cap, preserved when the query already sets
one. Default 10000.
timeout_ms: Postgres statement timeout in milliseconds. Default 5000.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A SELECT or WITH statement. `describe_memory_schema` returns the table and column names to write it against. | |
| max_rows | No | Automatic LIMIT cap, preserved when the query already sets one. Default 10000. | |
| timeout_ms | No | Postgres statement timeout in milliseconds. Default 5000. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||