diff --git a/go-api/internal/knowledge/retrieve.go b/go-api/internal/knowledge/retrieve.go index a3ed1ad..0ade8a3 100644 --- a/go-api/internal/knowledge/retrieve.go +++ b/go-api/internal/knowledge/retrieve.go @@ -49,7 +49,7 @@ const RRFConstant = 60.0 const CandidateMultiple = 3 // DefaultK is how many chunks a retrieval returns when the caller does not say. -const DefaultK = 8 +const DefaultK = 4 // MaxK is the ceiling. Not a performance guard — a context guard. Retrieved // text is prompt, prompt is money, and a caller asking for 500 chunks has made diff --git a/go-api/internal/tools/tools.go b/go-api/internal/tools/tools.go index c7604c8..cd3f49c 100644 --- a/go-api/internal/tools/tools.go +++ b/go-api/internal/tools/tools.go @@ -42,7 +42,11 @@ const ( // Not a performance guard. An unbounded result is an unbounded prompt on the // next turn, which is an unbounded bill and eventually a context overflow that // presents as the model ignoring the middle of its own evidence. -const DefaultMaxResultBytes = 262_144 +// 32KiB is roughly 8,000 tokens — already more evidence than any one answer +// needs, and an order of magnitude below the 256KiB this used to be. That old +// ceiling let ONE result outweigh everything else in the prompt put together, +// on a deployment whose provider ceiling is 8,000 tokens a minute. +const DefaultMaxResultBytes = 32_768 // Context is what a handler is given about its caller. // diff --git a/go-api/internal/tools/workforce.go b/go-api/internal/tools/workforce.go index 60d0228..3fcc0a0 100644 --- a/go-api/internal/tools/workforce.go +++ b/go-api/internal/tools/workforce.go @@ -69,8 +69,11 @@ func periodSchema(limitHelp string) map[string]any { "period": map[string]any{ "type": "string", "enum": []string{"today", "last-7-days", "last-30-days", "this-month", "previous-month"}, - "description": "The window to read. Omit for all recorded history. " + - "Windows are computed from the current date; do not pass a date.", + // Terse on purpose: this schema is attached to thirteen tools and + // the whole catalogue is re-sent on EVERY model call, so a + // sentence here is paid for once per tool per call. The "do not + // pass a date" warning is enforced by the enum anyway. + "description": "The window to read. Omit for all history.", }, "limit": map[string]any{ "type": "integer", "minimum": 1, "maximum": 100,