haiku.rag/haiku_rag_slim/haiku/rag/capabilities
Yiorgis Gozadinos 61a756da7f
Support Pydantic AI agent specs via from_spec
`Agent.from_spec` raised `TypeError` on `RAGCapability` and `AnalysisCapability`,
whose constructors take a state class, packaged instruction text and a tool-name
set, and silently omitted both from the generated spec schema. The two
zero-configuration capabilities constructed but with `id=None`, so pydantic-ai's
duplicate-id rejection no longer held and a spec could register two citation
policies, defeating the single-decision-maker invariant.

Override `from_spec` on all four, delegating to `create_capability()` so ids and
instructions come from one place. The spec surface is `db_path`, `config`,
`defer_loading`, `request_limit` and `vision`; a live `HaikuRAG` client stays out
of it, and a `config` mapping is validated through `AppConfig`.
2026-08-21 13:04:09 +03:00
..
instructions Let a model declare that nothing grounds its answer 2026-08-13 13:39:42 +03:00
__init__.py Give the evidence capabilities one typed state 2026-08-19 17:08:44 +03:00
_base.py Coerce a string db_path to Path at the Store and capability boundaries 2026-08-21 12:49:45 +03:00
_tools.py Return "No results found." and accumulate repeated search results 2026-08-21 10:09:25 +03:00
analysis.py Support Pydantic AI agent specs via from_spec 2026-08-21 13:04:09 +03:00
compaction.py Support Pydantic AI agent specs via from_spec 2026-08-21 13:04:09 +03:00
evidence.py Give the evidence capabilities one typed state 2026-08-19 17:08:44 +03:00
ledger.py Let the record say whether a question is still being answered 2026-08-13 15:03:24 +03:00
policy.py Support Pydantic AI agent specs via from_spec 2026-08-21 13:04:09 +03:00
rag.py Support Pydantic AI agent specs via from_spec 2026-08-21 13:04:09 +03:00