Search
Vrite provides a built-in, workspace-wide hybrid search powered by Weaviate and OpenAI’s API. Vrite chunks and index all content pieces following the headings (document structure) of each piece. The API allows you to both search and get answers to your questions via a question-answering endpoint based on GPT-4o.
Search
Searches the content base using the provided query. Can search for content chunks in the specified variant, content group, or content piece.
Additionally, it provides an option to limit the search results and search the content pieces (rather than chunks) by their title.
Query to search
Limit of results to return
ID of the variant to search in
ID of the content piece to search in
ID of the content group to search in
Whether to search only by the title
ID of the content piece
ID of the content piece
ISO-formatted date metadata of the content piece
Title of the content piece
Description of the content piece
IDs of the tags assigned to the content piece
URL of the cover image
Alt text of the cover image
ID of the content group the piece is directly assigned to
Custom JSON data of the content piece
Canonical link of the content piece
Slug of the content piece
Filename of the content piece
IDs of the workspace members assigned to the content piece
Breadcrumb leading to the result fragment (title + headings)
Raw text of the result
curl --request GET \
--url "https://api.vrite.io/search?query={QUERY}" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Accept: application/json'
const client = createClient({
token: "<API_TOKEN>"
});
const result = await client.search({
query:"string",
// Optional
limit: 8,
// Optional
variantId: "a9a55150f078ba1d1240cc45",
// Optional
contentGroupId:"13e4148f79235cea37a45553",
// Optional
contentPieceId:"deeff099c94664f7f884e2a7",
// Optional
byTitle: false
});
[
{
"contentPieceId": "string",
"contentPiece": {
"id": "bbe901d9e4a43a17cf660bb5",
"date": "string",
"title": "string",
"description": "string",
"tags": [
"deeff099c94664f7f884e2a7"
],
"coverUrl": "string",
"coverAlt": "string",
"contentGroupId": "13e4148f79235cea37a45553",
"customData": "string",
"canonicalLink": "string",
"slug": "string",
"filename": "string",
"members": [
"a9a55150f078ba1d1240cc45"
]
},
"breadcrumb": [
"string"
],
"content": "string"
}
]
Q&A Search
Uses Vrite search and GPT-4o with RAG to provide a simple question-answering experience for your Vrite workspace. It streams the answer via SSEs. Provides the same content filtering options as the /search
endpoint.
Query to ask
ID of the variant to search for references in
ID of the content group to search for references in
ID of the content piece to search for references in
curl --request GET \
--url "https://api.vrite.io/search/ask?query={QUERY}" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Accept: application/json'
const client = createClient({
token: "<API_TOKEN>",
});
const result = await client.ask({
query: "string",
// Optional
variantId: "a9a55150f078ba1d1240cc45",
// Optional
contentGroupId: "13e4148f79235cea37a45553",
// Optional
contentPieceId: "deeff099c94664f7f884e2a7",
// Callbacks
onChunk(chunk, content) {
console.log("Incoming chunk: ", chunk);
console.log("Part of the answer that was already streamed: ", content);
},
onEnd(content) {
console.log("Complete answer: ", content);
},
onError(error) {
console.error(error);
},
});