You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,12 +10,13 @@ Suckless by design. No browser session, no curator UI, no PDF/video pipeline, no
10
10
11
11
Two-stage pipeline per call:
12
12
13
-
1.**Retrieve** via Exa / Context7 / git clone. Full payload written to disk under a `responseId`.
14
-
2.**Distill** before returning:
15
-
- Small payloads → deterministic compaction (no model call).
16
-
- Larger payloads → your active Pi model runs as a context firewall: fixed sections, every claim cites `[S#]`, retrieved text treated as untrusted data. Output is validated; bad runs fall back to raw.
13
+
1.**Retrieve** via Exa / Context7 / git clone. Raw evidence is stored out-of-band under a `responseId`; session persistence is bounded so long runs do not bloat context/history.
14
+
2.**Distill/extract** before returning:
15
+
- Small payloads → deterministic extractive compaction (no model call).
16
+
- Larger payloads → your active Pi model runs as a context firewall over ranked snippets: fixed sections, every finding cites `[S#]`, retrieved text treated as untrusted data. Output is validated.
17
+
- If model distillation is unavailable, the fallback is a bounded extractive report, not a first-N raw dump.
17
18
18
-
You pay one small model call to avoid pasting 50k tokens of HTML into the main context. Override the distiller with `PI_WEB_MINIMAL_DISTILL_MODEL=provider/model-id`. Set `PI_OFFLINE=1` to skip distillation entirely.
19
+
You pay one small model call to avoid pasting 50k tokens of HTML into the main context. Override the distiller with `PI_WEB_MINIMAL_DISTILL_MODEL=provider/model-id`. Set `PI_OFFLINE=1` to skip model distillation and use deterministic extraction.
19
20
20
21
## Install
21
22
@@ -39,7 +40,7 @@ Or `~/.pi/web-search.json`:
39
40
|`code_search`| API/code examples |
40
41
|`documentation_search`| live library docs (Context7) |
41
42
|`fetch_content`| URLs + GitHub repos (shallow-cloned to `/tmp/pi-github-repos`) |
42
-
|`get_search_content`| raw escape hatch by `responseId` when distillation dropped something you needed |
43
+
|`get_search_content`| raw escape hatch by `responseId`with `sourceIndex`/`urlIndex`, `offset`, `section`, or `textSearch` selectors when distillation dropped something you needed |
Copy file name to clipboardExpand all lines: docs/agent-tool-audit.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ pi-web-minimal is intentionally a retrieval + distillation package, not a browse
14
14
15
15
## Current verdict
16
16
17
-
The package follows the new core pattern: five retrieval tools, no UI workflow, adaptive context-firewall output, raw evidence stored out of context, and no broad provider fallback stack. Tiny evidence is compacted deterministically; larger evidence is model-distilled with source refs. The main context-risk remains `get_search_content`: it can rehydrate large stored content into the conversation. It returns a bounded slice by default and requires `maxCharacters` to opt into more context.
17
+
The package follows the core pattern: five retrieval tools, no UI workflow, adaptive context-firewall output, raw evidence stored out of context, and no broad provider fallback stack. Visible output is extractive-first: ranked findings plus a source manifest. Tiny evidence is compacted deterministically; larger evidence is model-distilled with source refs; model failures fall back to bounded extractive findings rather than raw previews. The main context-risk remains `get_search_content`, now mitigated by a tighter default budget plus `sourceIndex`/`urlIndex`, `offset`, `section`, and `textSearch` selectors.
18
18
19
19
## Tool surface
20
20
@@ -24,17 +24,17 @@ The package follows the new core pattern: five retrieval tools, no UI workflow,
24
24
|`code_search`| Code/API examples and references | Compact or distilled source-cited brief; stores raw result by query index. |
25
25
|`documentation_search`| Current library/framework docs via Context7 | Compact or distilled source-cited brief; stores raw documentation context by query index. |
26
26
|`fetch_content`| Specific URL/GitHub retrieval | Compact or distilled source-cited brief for fetched URL batches; stores raw per-URL content. |
27
-
|`get_search_content`| Explicit raw stored-content retrieval |Bounded raw content by default; caller chooses selector and `maxCharacters`. |
27
+
|`get_search_content`| Explicit raw stored-content retrieval |Tighter bounded raw content by default; caller chooses source/url/query plus offset, heading section, text search, and `maxCharacters`. |
28
28
29
29
Keeping these as separate tools is deliberate: the names map to distinct agent intents and avoid a large router schema.
30
30
31
31
## Context-pollution notes
32
32
33
33
-`appendEntry()` custom entries are not sent to the LLM, so stored raw results avoid immediate context pollution.
34
-
- Session files can still grow because stored content and distilled briefs are persisted for branch/reload recovery. This is acceptable for now because retrieval continuity and auditability are more valuable than an external cache, but it should be watched in eval reports.
34
+
- Session persistence is deliberately bounded: full raw evidence stays in memory for the active session, while persisted custom entries are capped to preserve reload continuity without unbounded session growth.
35
35
- Tool output must remain compact. Future additions should improve evidence selection, citations, selectors, filtering, pagination, or explicit retrieval rather than larger default outputs.
36
-
- Tiny raw evidence should not be expanded through a model. Use deterministic compact mode unless the source is large enough to need synthesis.
37
-
- Retrieved web/docs/code content is untrusted. Compact mode strips obvious instruction-like lines. Distillation prompts must separate source blocks from instructions and require source refs for substantive claims.
36
+
- Tiny raw evidence should not be expanded through a model. Use deterministic extractive compact mode unless the source is large enough to need synthesis.
37
+
- Retrieved web/docs/code content is untrusted. Extractive output filters obvious instruction-like lines. Distillation prompts must separate source blocks from instructions and require source refs for substantive claims.
0 commit comments