Search existing knowledge for a passage
client.trainingData.search(TrainingDataSearchParams { query, excludeIds, kinds, 2 more } params, RequestOptionsoptions?): KnowledgeSearch { candidates, object, query, timings }
POST/v2/training_data/search
Searches one passage or claim across Q&A, training files, and live help-center articles. Returns ranked candidates and query-focused excerpts without judging or writing. Similarity is an embedding score, not factual confidence; calibrate thresholds on representative examples and retain keyword-only results (similarity null). Retrieval and excerpts can miss relevant facts. Fetch full sources for decisions. Split long documents into bounded sections and audit each section before upload. Latency and embedding work depend on query size and service load.
Search existing knowledge for a passage
import Featurebase from 'featurebase-node';
const client = new Featurebase({
apiKey: process.env['FEATUREBASE_API_KEY'], // This is the default and can be omitted
});
const knowledgeSearch = await client.trainingData.search({
query: 'Refunds are processed within 14 days of the request.',
});
console.log(knowledgeSearch.candidates);{
"candidates": [
{
"id": "67ec1234abcd5678ef901236",
"externalId": null,
"kind": "qna",
"questions": [
"How do I request a refund?"
],
"revision": 1,
"section": null,
"similarity": 0.61,
"source": null,
"text": "You can request a refund within 30 days from **Settings → Billing**.",
"title": "Refund requests",
"url": null
}
],
"object": "knowledge_search",
"query": "Refunds are processed within 14 days of the request.",
"timings": {
"retrievalMs": 690
}
}Returns Examples
{
"candidates": [
{
"id": "67ec1234abcd5678ef901236",
"externalId": null,
"kind": "qna",
"questions": [
"How do I request a refund?"
],
"revision": 1,
"section": null,
"similarity": 0.61,
"source": null,
"text": "You can request a refund within 30 days from **Settings → Billing**.",
"title": "Refund requests",
"url": null
}
],
"object": "knowledge_search",
"query": "Refunds are processed within 14 days of the request.",
"timings": {
"retrievalMs": 690
}
}