@bootstrapware/answers 0.2.4 → 0.2.5
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/AGENTS.md +5 -3
- package/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -143,6 +143,8 @@ const answers = createAnswersBackend({
|
|
|
143
143
|
export const POST = (request: Request) => answers.handler(request);
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
+
Custom Q&A changes at runtime with no refresh: `await answers.upsertQa({ id, question, answer })`, `answers.removeQa(id)`, or `answers.setQa([...])`. Only the changed entry is embedded. To keep your own vector store, pass `retrieve` or call `answerQuestion` with your retrieval; custom Q&A is still always considered.
|
|
147
|
+
|
|
146
148
|
The full reference app is `examples/answers-nextjs` (markdown knowledge on disk, a JSON visitor log).
|
|
147
149
|
|
|
148
150
|
Citations must be ids you retrieved. The widget links a URL only when that URL is on the returned citation. Other URLs stay text. HTML in the answer stays text.
|
|
@@ -227,8 +229,8 @@ Hosted indexes the main body of each page, split by headings; navigation, header
|
|
|
227
229
|
1. Make sure the fact is stated in a page body, not only implied by a homepage card. A pricing page, a support page, and one page per product work well.
|
|
228
230
|
2. Keep each figure next to what it prices (`Hosted is $19.99/month`). An answer whose price or number is not in a cited passage is rejected.
|
|
229
231
|
3. After `add_answers_url_source`, wait for the index job, then use the dashboard retrieval check to see which passages a question finds. Ask through the widget with a test key to see the written answer.
|
|
230
|
-
4. For facts you want stated exactly (prices, refund policy, support contact), add a custom Q&A in the dashboard. Custom Q&A
|
|
231
|
-
5. Unanswered is the correct outcome when
|
|
232
|
+
4. For facts you want stated exactly (prices, refund policy, support contact), add a custom Q&A in the dashboard. Custom Q&A is always considered, and a matching entry is answered first. Hosted entries are indexed on save, usually within about a minute; the dashboard knowledge list shows when each is indexed. With BYO, an entry changed through `upsertQa`, `removeQa`, or `setQa` applies from the next question.
|
|
233
|
+
5. When the pages are silent on a yes/no question (certification, compliance, encryption), the answer says the site does not state it and gives the support contact if a source has one. Add the support contact as a custom Q&A so that works. Unanswered with the fallback is the correct outcome when nothing covers the question. Add a URL or a custom Q&A. Do not send the question through MCP.
|
|
232
234
|
|
|
233
235
|
## Knowledge, grounding, and provider
|
|
234
236
|
|
|
@@ -236,7 +238,7 @@ Hosted knowledge kinds are website root, sitemap, single public URL, PDF, DOCX,
|
|
|
236
238
|
|
|
237
239
|
Every Hosted source is visitor-readable. Do not upload private runbooks or secrets. Crawl is public `http` and `https` only. Private hosts are rejected. `robots.txt` is honored. A failed crawl leaves the last good index in place. A page that is only navigation chrome is rejected and does not become a citation.
|
|
238
240
|
|
|
239
|
-
Retrieval combines keyword and embedding search over the active index
|
|
241
|
+
Retrieval combines keyword and embedding search over the active index. Custom Q&A is always considered, and a matching entry is answered first. The model answers in 1 to 4 sentences in the visitor's language, citing passages it was given; citations are ids from the retrieved index, and the model does not invent URLs. A draft that cites an unretrieved passage, states a figure no cited passage contains, or writes code not quoted from a passage is retried once and then returns `unanswered` with the configured fallback. Off-topic questions and prompt-injection attempts are declined before retrieval. How-to questions get the documented steps and a citation to the docs page; the model does not write new code. There is no model-memory fallback. Earlier turns are used only for clear follow-ups ("what about Chat?"); a standalone question is answered fresh.
|
|
240
242
|
|
|
241
243
|
Unanswered observations store normalized question text even when conversation history is off, so the dashboard can group them. MCP does not return that text.
|
|
242
244
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.5
|
|
4
|
+
|
|
5
|
+
- Docs only, no code changes. README and AGENTS.md match the v2 behavior: custom Q&A is always considered and a matching entry is answered first (replaces "ranks ahead of page text"); when the sources are silent the answer says the site does not state it and gives the support contact if a source has one; `answerQuestion` over your own retrieval and runtime Q&A changes; how-to questions cite the docs page without writing new code; earlier turns are used only for clear follow-ups. Hosted entries are indexed on save, usually within about a minute; with BYO, an entry changed through `upsertQa`, `removeQa`, or `setQa` applies from the next question.
|
|
6
|
+
|
|
3
7
|
## 0.2.4
|
|
4
8
|
|
|
5
9
|
- Session context: earlier turns help only with clear follow-ups. Every question is routed on its own first, exactly as in a new session, and the router flags `followup` (a pronoun with no subject, "what about Chat?", "and the price?"). Only follow-ups are rewritten with the conversation (carrying over just the referent), and only they show earlier turns to the answer step; if the follow-up reading finds nothing, the question is answered on its own. A self-contained question asked late in a long session gets the same retrieval and answer as in a new session.
|
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ export const POST = (request: Request) => answers.handler(request);
|
|
|
59
59
|
|
|
60
60
|
The index is built on the first question and kept in memory. Call `answers.refresh()` after your content changes, or save `answers.index.toJSON()` and pass it back as `snapshot` to skip re-embedding on restart. Pass `retrieve` to use your own vector store instead.
|
|
61
61
|
|
|
62
|
-
Answers come only from the indexed passages. A draft that cites something it did not retrieve, or states a price or number no cited passage contains, is rejected and the visitor gets the fallback. Custom Q&A
|
|
62
|
+
Answers come only from the indexed passages. A draft that cites something it did not retrieve, or states a price or number no cited passage contains, is rejected and the visitor gets the fallback. Custom Q&A is always considered, and a matching entry is answered first. When the sources are silent on a yes/no question, the answer says the site does not state it (with the support contact if a source has one). How-to questions cite the docs page; no new code is written.
|
|
63
63
|
|
|
64
64
|
Custom Q&A can change at runtime without a refresh: call `await answers.upsertQa({ id, question, answer })`, `answers.removeQa(id)`, or `answers.setQa([...])` from your save handler. Only the changed entry is embedded and it answers on the next question. Relevant custom Q&A are always offered to the model, even when many page passages outrank them, and that includes setups that pass their own `retrieve`.
|
|
65
65
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bootstrapware/answers",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Embeddable source-backed Q&A for your site: React widget plus a server engine (crawl, hybrid search, grounded OpenAI answers with citations) for BYO backends.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|