Commit graph

32 commits

Author SHA1 Message Date
Yiorgis Gozadinos
0d7810c78a
Render collection identity only for multi-collection searches
`format_for_agent` named the database whenever one was named, so a search over
a single named database carried a line with nothing to distinguish. It now takes
`include_collection` from the caller, which decides from the search selection
rather than from the hits: a search that could have drawn on two collections
names them even when everything came back from one.

`Collection:` at the model boundary, database in configuration and
administration. `source` on results, documents, citations and analysis
dictionaries is unchanged.
2026-08-27 12:41:05 +03:00
Yiorgis Gozadinos
307e250f29
Select documents to filter by id, not by displayed name
A title repeats within a corpus and across databases, so a substring
match on the displayed name widened the filter to documents the user did
not pick. The label names the database.
2026-08-24 15:27:59 +03:00
Yiorgis Gozadinos
e8f00fcff4
Make get_config the only configuration lookup
haiku.rag.config exported two configuration instances: the lazy _config
behind get_config/set_config, and Config, loaded at import time. Nothing
linked them, and eleven signatures captured Config as a default argument,
so set_config could not reach the factories, the client, the store or the
MCP server. reranking/base.py went further and snapshotted the configured
reranker name into a class attribute at import.

Config is removed. Internal defaults are config: AppConfig | None = None,
resolved through get_config() per call. RerankerBase._model is None and
CohereReranker takes its model name as an argument, like every other
reranker.

The suite patched attributes on Config while production read the instance
get_config() returns, a different object, so those patches were no-ops
waiting to happen. They now go through get_config().
2026-08-19 14:43:40 +03:00
Yiorgis Gozadinos
46f7ab8d97
Name the search result each page image belongs to
ToolReturn.content reaches the model as a user-role message and the pictures
arrive bare, so nothing connects a figure to the chunk it came from:
BinaryContent.identifier does not survive serialization to the vision API, and
the captions in the result text correlate only by position.

Precede each picture with its position, source chunk id and self_ref.
build_binary_parts_from_results becomes build_image_content_from_results and
returns the labels interleaved with the pictures, so both attachment sites emit
them the same way.

This does not stop a model narrating retrieved pictures as user-supplied.
Measured on gemma4-26b with a single note ahead of the batch, and again with
per-image labels: it quotes the label and still says the user provided them.
The message role wins over its text.
2026-08-13 13:00:01 +03:00
Yiorgis Gozadinos
f13a3fb677
Report tool failures with ToolFailed 2026-07-27 18:26:42 +03:00
Yiorgis Gozadinos
f6acb65e95
Reach and enforce 100% coverage
Cover the remaining paths in the client, context, downloads, title
generation, document tools and store models, and add fail_under=100 so
uncovered lines fail CI.

Six lines that no test can reach get a pragma with its reason: the docling
import guard, the nameless PDF attachment, the FS symlink OSError guard that
resolve(strict=False) absorbs, the docling bbox and LanceDB document-id
shape guards, the tag-retention branch vacuum makes unreachable, and Monty's
Rust-thread print callback.

Fix test_find_config_file_user_config, which wrote its config into the cwd it
had chdir'd to, so the cwd branch answered first and the user-directory
lookup it names was never exercised.
2026-07-26 20:11:02 +03:00
Yiorgis Gozadinos
7c120587f0
Cover sandbox VFS reads, binary part dedup and picture spans 2026-07-26 19:41:09 +03:00
Yiorgis Gozadinos
eb4e1721ce
remove dead code, add tool descriptions in frontend, update changelog 2026-04-20 15:38:17 +03:00
Yiorgis Gozadinos
aa4ce07dc9
remove filter parameter from analyze skill tool and clean up unused filter helpers 2026-04-17 18:35:16 +03:00
Yiorgis Gozadinos
499a843a43
remove unused create_analysis_toolset and AnalysisResult 2026-04-17 18:32:01 +03:00
Yiorgis Gozadinos
e2749ad2a6
Cap QA agent search iterations to reduce response time 2026-03-11 12:13:43 +02:00
Yiorgis Gozadinos
1a3ea64aa6
Remove filter parameter from search and list_documents tools 2026-03-03 11:01:58 +02:00
Yiorgis Gozadinos
ed89ff0fc9
Simplify tools/ — remove AG-UI state machinery, keep core toolsets 2026-02-20 16:36:48 +02:00
Yiorgis Gozadinos
f4735667df
emit StateDeltaEvent with client-aware baseline 2026-02-17 12:24:09 +02:00
Yiorgis Gozadinos
7ff2123806
Introduce toolkit to reduce toolset creation ceremony 2026-02-16 11:51:02 +02:00
Yiorgis Gozadinos
72c8f6e1b1
Additional tests 2026-02-13 18:08:46 +02:00
Yiorgis Gozadinos
969c64d106
Add citations_history to SessionState for unified citation rendering between search and ask 2026-02-13 16:21:50 +02:00
Yiorgis Gozadinos
c0ed93da2d
Expand tests 2026-02-13 14:34:24 +02:00
Yiorgis Gozadinos
5f6d9e9812
handle state_key duplication between deps and ToolContext 2026-02-13 10:23:12 +02:00
Yiorgis Gozadinos
a5b8e3be7e
Add AgentDeps and prepare_context for custom agent DX 2026-02-12 17:37:37 +02:00
Yiorgis Gozadinos
8f180f707b
Decouple QA toolset from chat agent, add ToolContext state methods 2026-02-12 17:27:47 +02:00
Yiorgis Gozadinos
05ebd781d4
Move client and tool_context from toolset factories to RunContext.deps 2026-02-12 15:50:46 +02:00
Yiorgis Gozadinos
d67df09cce
Introduce ToolContextCache 2026-02-11 14:18:26 +02:00
Yiorgis Gozadinos
a592a04031
Removed unused accumulator states 2026-02-10 16:15:30 +02:00
Yiorgis Gozadinos
da47e3e345
Unify get_typed() into get() with optional type parameter
Fix find_document regression
2026-02-10 14:38:14 +02:00
Yiorgis Gozadinos
0dd181356e
Update vcr 2026-02-10 14:38:14 +02:00
Yiorgis Gozadinos
bd3b26f78b
Extract get_session_filter helper, remove dead code and duplicate tests 2026-02-10 14:38:13 +02:00
Yiorgis Gozadinos
84b320765a
Fix analysis tool to use docker sandbox 2026-02-10 14:38:13 +02:00
Yiorgis Gozadinos
3ed9cbb7d3
Use the tools inside the chat agent. 2026-02-10 14:38:12 +02:00
Yiorgis Gozadinos
2be3389222
DocumentToolset, QAToolset, AnalysisToolset 2026-02-10 14:38:12 +02:00
Yiorgis Gozadinos
2f229f91e1
Create SearchToolset, refactor QA Agent to use it 2026-02-10 14:38:12 +02:00
Yiorgis Gozadinos
a3863882cd
Introduce tool module & ToolContext to save state 2026-02-10 14:38:12 +02:00