@tangle-network/agent-knowledge 4.0.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/AGENTS.md +35 -19
  2. package/CHANGELOG.md +48 -0
  3. package/README.md +220 -943
  4. package/dist/benchmarks/index.d.ts +3 -2
  5. package/dist/benchmarks/index.js +1 -1
  6. package/dist/{chunk-EUAXSBMH.js → chunk-AKYJG2MR.js} +224 -224
  7. package/dist/chunk-AKYJG2MR.js.map +1 -0
  8. package/dist/{chunk-BBCIB4UL.js → chunk-EYIA5PLQ.js} +27 -195
  9. package/dist/chunk-EYIA5PLQ.js.map +1 -0
  10. package/dist/{chunk-3CAAGJCE.js → chunk-LMR53POQ.js} +1227 -574
  11. package/dist/chunk-LMR53POQ.js.map +1 -0
  12. package/dist/{chunk-WCYW2GDA.js → chunk-MYFM6LKH.js} +2 -2
  13. package/dist/chunk-MYFM6LKH.js.map +1 -0
  14. package/dist/cli.js +1 -1
  15. package/dist/index-Cf7txrYP.d.ts +790 -0
  16. package/dist/index.d.ts +252 -73
  17. package/dist/index.js +2813 -2229
  18. package/dist/index.js.map +1 -1
  19. package/dist/memory/index.d.ts +8 -709
  20. package/dist/memory/index.js +2 -2
  21. package/dist/sources/index.d.ts +17 -33
  22. package/dist/sources/index.js +1 -1
  23. package/dist/{types-ZzY_x0r7.d.ts → types-BY-xLVw-.d.ts} +28 -67
  24. package/docs/eval/investment-material-facts.md +28 -29
  25. package/docs/eval/rag-eval-roadmap.md +21 -17
  26. package/docs/results/adaptive.md +13 -13
  27. package/docs/results/claim-grounding.md +11 -11
  28. package/docs/results/cost-quality.md +4 -4
  29. package/docs/results/investment-thesis.md +56 -56
  30. package/docs/results/research-driving.md +54 -54
  31. package/docs/two-agent-research-ab.md +94 -94
  32. package/package.json +11 -11
  33. package/skills/build-with-agent-knowledge/SKILL.md +97 -0
  34. package/dist/chunk-3CAAGJCE.js.map +0 -1
  35. package/dist/chunk-BBCIB4UL.js.map +0 -1
  36. package/dist/chunk-EUAXSBMH.js.map +0 -1
  37. package/dist/chunk-WCYW2GDA.js.map +0 -1
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: build-with-agent-knowledge
3
+ description: Build, evaluate, and improve source-backed knowledge, retrieval, and memory systems.
4
+ ---
5
+
6
+ # Build With Agent Knowledge
7
+
8
+ Use this when a product needs a knowledge base, retrieval system, RAG improvement process, or agent memory provider.
9
+ Read the installed package README, exports, types, and nearest tests before choosing an API.
10
+ Do not copy signatures from this skill.
11
+
12
+ ## Choose The Job
13
+
14
+ | Product need | Package capability |
15
+ |---|---|
16
+ | Start a source-backed Markdown knowledge base | File knowledge base and source registry |
17
+ | Search an existing package knowledge base | File search provider or a product search adapter |
18
+ | Improve knowledge without editing live files | Isolated knowledge candidates |
19
+ | Tune retrieval on labeled questions | Retrieval improvement loop |
20
+ | Diagnose and repair retrieval, sources, pages, and answers together | RAG knowledge improvement loop |
21
+ | Compare memory systems | Memory adapter and experiment APIs |
22
+ | Run retrieval, answer, knowledge, or memory cases | Knowledge benchmark APIs |
23
+ | Let agents research or edit candidates | Runtime knowledge integration |
24
+
25
+ Use the narrowest capability that solves the product problem.
26
+ Do not add an agent loop when deterministic ingestion or indexing is enough.
27
+
28
+ ## Define Truth And Success
29
+
30
+ Record:
31
+
32
+ - the user task the knowledge should improve;
33
+ - authoritative and disallowed sources;
34
+ - tenant, user, agent, and sharing scope;
35
+ - freshness and deletion requirements;
36
+ - the current retrieval, answer, or memory baseline;
37
+ - objective checks, semantic checks, cost, and latency limits;
38
+ - who may approve and apply a candidate.
39
+
40
+ Use independent labels and source evidence.
41
+ The agent's current answer is not a gold answer.
42
+
43
+ ## Keep The Boundary Clean
44
+
45
+ `agent-knowledge` owns source records, indexes, retrieval tests, memory contracts, isolated candidates, and exact promotion.
46
+ It does not own model choice, prompts, browsing, agent scheduling, product authorization, or product storage transactions.
47
+
48
+ Supply callbacks for research, retrieval, answer generation, and scoring.
49
+ Use `@tangle-network/agent-runtime/knowledge` when those callbacks should run agents.
50
+ Use existing vector, graph, search, and memory systems through adapters instead of rebuilding their databases here.
51
+
52
+ ## Build The Smallest Complete Path
53
+
54
+ 1. Ingest one real source with provenance and tenant scope.
55
+ 2. Build or connect the index used by the product.
56
+ 3. Run one representative query or memory sequence through the production path.
57
+ 4. Capture retrieved items, final answer or action, citations, errors, tokens, cost, and latency.
58
+ 5. Prove a known good case passes and a realistic unsupported or missed case fails.
59
+ 6. Add only the missing improvement step: retrieval search, source acquisition, page update, answer repair, or memory policy.
60
+ 7. Write changes to an isolated candidate with a stable run identity.
61
+ 8. Compare baseline and candidate on the same development cases, then on unseen cases.
62
+ 9. Apply only an approved candidate whose base identity is still current.
63
+
64
+ Use separate run IDs for parallel branches and the same run ID to resume interrupted work.
65
+ Reject stale promotion rather than replacing newer knowledge.
66
+
67
+ ## Evaluate The Right Layer
68
+
69
+ | Layer | Minimum evidence |
70
+ |---|---|
71
+ | Retrieval | Labeled relevant items, ranking measures, misses, latency, and cost |
72
+ | Answer | Claim support, relevance, citation correctness, abstention, and final text |
73
+ | Knowledge base | Source coverage, provenance, freshness, structure, conflicts, and validation findings |
74
+ | Memory | Multi-turn task outcome, correct recall, harmful recall, isolation, writes, latency, and cost |
75
+
76
+ Report service and measurement failures separately from product failures.
77
+ Keep candidate-generation cases separate from the final decision set.
78
+ Bundled benchmark samples prove adapter wiring only; use complete external datasets for benchmark claims.
79
+
80
+ ## Completion
81
+
82
+ One customer-like path must prove:
83
+
84
+ ```text
85
+ source or memory event -> production retrieval -> observable answer or action
86
+ -> isolated candidate -> baseline comparison -> unseen comparison
87
+ -> approved promotion or correctly rejected change -> reproducible rerun
88
+ ```
89
+
90
+ Report installed versions, exact imports, provider adapters, scope policy, case counts, baseline and candidate results, cost, latency, candidate identity, promotion result, and artifact paths.
91
+
92
+ ## Then consider
93
+
94
+ - `eval-engineering` when new production-derived cases are needed.
95
+ - `build-with-agent-runtime` when agents should research, edit, or compare candidates.
96
+ - `agent-eval-adoption` when the product needs shared comparison and release records.
97
+ - `harden` when changing tenant isolation, source trust, deletion, or promotion authority.