Generalize agentic operators: composable ops, filter as map, execution strategies
Replace the single agentic_map_reduce entry point with a general corpus.agent(task=..., ops=[...], tools=...) that runs an ordered pipeline of agentic ops over a corpus: - ops: "map" / "filter" / "reduce", composable or standalone. map/filter are Corpus->Corpus (chainable); reduce collapses to one answer (terminal, validated). - filter is an instantiation of map: the same execution core, where each unit's agent result is read as a keep/drop verdict selecting the returned corpus. - execution strategies per corpus op (per_unit | batched | shared_context) control how much context each per-unit decision gets. batched yields one result *per unit* via structured JSON (with sibling context); shared_context injects background. - the planner chooses each op's instruction and strategy from the task + corpus stats/sample; strategies/contexts can be overridden on corpus.agent. Remove the old API (agentic_map_reduce method/function + agentic_map/filter/reduce helpers) in favor of the single corpus.agent surface. Migrate the README quickstart and examples/ scripts; add a runnable buggy_filter.py that needs tool use. Bump the arithmetic (expense) examples to gpt-5 reasoning=low for reliable exact reduction. Docs: rename sections (Agentic Semantic Operators / LLM Semantic Operators / Optimizations), add Agentic Operators, Corpus, and Agentic Filter pages, restructure Core Concepts around the two operator classes with a shared SVG, and drop the old Examples page. Offline tests cover ops validation, strategies, batched map/filter, shared-context injection, and the map->reduce/filter pipelines. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F8uVd6FvQ5q25oLt2Q27YK
L
liana313 committed
757357c1383770eec45caa3abcdb3dec1fd726e0
Parent: d17554a