@absolutejs/rag 0.13.0 → 0.14.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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,16 @@ This file is generated by `absolute-changelog` from the entries in
6
6
  `changelog/`. Edit an entry, not this file — and add new ones under
7
7
  `changelog/unreleased/`.
8
8
 
9
+ ## 0.14.0 — 2026-09-18
10
+
11
+ ### Added
12
+
13
+ - **Return copy-ready source citations before website evidence and repeat links beside each retrieved page; exclude failed reads and unread links from the source list.** (`readRAGWebsite`)
14
+
15
+ ### Changed
16
+
17
+ - **Require nearby source links for factual answers and distinguish supported customer examples from unsupported exclusions, ownership relationships and rebrand history.** (`readRAGWebsite`)
18
+
9
19
  ## 0.13.0 — 2026-09-18
10
20
 
11
21
  ### Added
package/README.md CHANGED
@@ -184,3 +184,10 @@ separately. Empty image labels are not proof of an absent client list, and media
184
184
  URLs are not proof that a video was watched. Consumers must cite source URLs,
185
185
  distinguish extracted evidence from inference, and finish the requested research
186
186
  without treating a successful page fetch as complete company coverage.
187
+
188
+ Website results also lead with a `sources` array containing each readable page's
189
+ `title`, `url` and ready-to-use Markdown `citation`, repeated next to that page's
190
+ evidence text. Failed pages and unvisited links are not citable source entries.
191
+ `citationRequirements` asks consumers to place links beside supported claims,
192
+ avoid unsupported exclusions or ownership relationships, and keep verified brand
193
+ changes brief. Host applications still control their generated final answers.
package/changelog.json CHANGED
@@ -2,6 +2,26 @@
2
2
  "contract": 1,
3
3
  "name": "@absolutejs/rag",
4
4
  "releases": [
5
+ {
6
+ "changes": [
7
+ {
8
+ "kind": "changed",
9
+ "summary": "Require nearby source links for factual answers and distinguish supported customer examples from unsupported exclusions, ownership relationships and rebrand history.",
10
+ "symbols": [
11
+ "readRAGWebsite"
12
+ ]
13
+ },
14
+ {
15
+ "kind": "added",
16
+ "summary": "Return copy-ready source citations before website evidence and repeat links beside each retrieved page; exclude failed reads and unread links from the source list.",
17
+ "symbols": [
18
+ "readRAGWebsite"
19
+ ]
20
+ }
21
+ ],
22
+ "date": "2026-09-18",
23
+ "version": "0.14.0"
24
+ },
5
25
  {
6
26
  "changes": [
7
27
  {
@@ -59,4 +59,10 @@ export declare const readRAGWebsite: (options: ReadWebpageOptions & {
59
59
  redirects: import("./transport").WebRedirect[];
60
60
  evidence: import("./evidence").WebEvidence;
61
61
  limitations: string[];
62
+ sources: {
63
+ title: string;
64
+ url: string;
65
+ citation: string;
66
+ }[];
67
+ citationRequirements: string;
62
68
  }>;
package/dist/web/index.js CHANGED
@@ -17786,7 +17786,14 @@ var readRAGWebsite = async (options) => {
17786
17786
  });
17787
17787
  }
17788
17788
  }
17789
+ const sources = pages.filter((page) => page.status !== "error" && page.text).map((page) => {
17790
+ const title = (page.title || new URL(page.finalUrl).hostname).replace(/\s+/gu, " ").trim();
17791
+ const label = title.replace(/[\\[\]]/gu, "\\$&");
17792
+ const href = page.finalUrl.replace(/[<>]/gu, encodeURIComponent);
17793
+ return { title, url: page.finalUrl, citation: `[${label}](<${href}>)` };
17794
+ });
17789
17795
  const evidenceText = pages.filter((page) => page.status !== "error").map((page) => `SOURCE: ${page.finalUrl}
17796
+ CITATION: ${sources.find((source) => source.url === page.finalUrl)?.citation ?? page.finalUrl}
17790
17797
  TITLE: ${page.title ?? "Untitled"}
17791
17798
  ${page.text}`).join(`
17792
17799
 
@@ -17795,6 +17802,8 @@ ${page.text}`).join(`
17795
17802
  const incomplete = pages.some((page) => page.status !== "ok") || signal.aborted;
17796
17803
  const unvisited = queue.filter((link) => !visited.has(link.url.split("#")[0]));
17797
17804
  return {
17805
+ sources,
17806
+ citationRequirements: "The final answer must contain clickable Markdown source links, not just source names or bare domain mentions. Reuse sources[].citation beside the factual paragraph, list or table row it supports. Cite the actual supporting page, not the homepage for everything. Every factual section needs its supporting links. Do not invent sources or use unread links as evidence. Before responding, check that company facts, service descriptions, customer examples and numerical claims have supporting links; retrieve or omit unsupported claims. A list of large customers does not prove smaller customers are excluded. Preserve the brands actually named in the evidence; do not append parent companies, ownership relationships, current-account status, market rankings or rebrand history from memory. Label reasoned inferences as such. A verified brand change needs at most one short, cited sentence unless the user asks for its history.",
17798
17807
  ...first,
17799
17808
  status: readable.length ? incomplete ? "partial" : "ok" : "error",
17800
17809
  text: evidenceText.slice(0, maxChars),
@@ -17993,5 +18002,5 @@ export {
17993
18002
  validatePublicWebUrl
17994
18003
  };
17995
18004
 
17996
- //# debugId=637AD9688A7D497B64756E2164756E21
18005
+ //# debugId=C770BC61DAD3A78A64756E2164756E21
17997
18006
  //# sourceMappingURL=index.js.map