Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs edit #42

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions pages/docs/api/search/keyword-search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ Keyword search can be operated on an any object's `string` or `string[]` field.
<Tabs size={"sm"} variant={"underlined"} className={"mt-2"}>
<Tab title={"Unbody SDK"}>
```jsx
const {data: {payload}} = await unbody.get
.googleDoc
.search
.find("specific keyword");
const {
data: { payload },
} = await unbody.get.googleDoc.search.find("specific keyword").exec();

// payload is an array of GoogleDocs that match "specific keyword"
```
Expand All @@ -63,15 +62,14 @@ Keyword search can be operated on an any object's `string` or `string[]` field.
</Tab>
</Tabs>

### Example 3 - Any text block
### Example 2 - Any text block

<Tabs size={"sm"} variant={"underlined"} className={"mt-2"}>
<Tab title={"Unbody SDK"}>
```jsx
const {data: {payload}} = await unbody.get
.textBlock
.search
.find("specific keyword");
```jsx
const {
data: { payload },
} = await unbody.get.textBlock.search.find("specific keyword").exec();

// payload is an array of textBlocks that match "specific keyword"
// this search includes all types of objects available in the sources of your project
Expand All @@ -95,15 +93,14 @@ Keyword search can be operated on an any object's `string` or `string[]` field.
</Tab>
</Tabs>

### Example 4 - Google Drive / Google Docs - specific fields
### Example 3 - Google Drive / Google Docs - specific fields

<Tabs size={"sm"} variant={"underlined"} className={"mt-2"}>
<Tab title={"Unbody SDK"}>
```jsx
const {data: {payload}} = await unbody.get
.googleDoc
.search
.find("specific keyword", ["title", "autoSummary"]);
const {
data: { payload },
} = await unbody.get.googleDoc.search.find("specific keyword", ["title", "autoSummary"]).exec();

// payload is an array of GoogleDocs that match "specific keyword" - but here the search only is executed over two specifiec fields; "title" and "autoSummary"
```
Expand Down
26 changes: 10 additions & 16 deletions pages/docs/api/search/record-similarity.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Tab, Tabs} from "@nextui-org/react";

Similarity Record is a way to see how alike objects are. You can use this to find objects that look like a specific one. For instance, if you have many Google Docs, you can use this to find docs that are like Doc A. In the past, you had to look at things like keywords or topics to find similar items. But with similarity search in Unbxd, this isn't necessary. You can compare the whole document.
Similarity Record is a way to see how alike objects are. You can use this to find objects that look like a specific one. For instance, if you have many Google Docs, you can use this to find docs that are like Doc A. In the past, you had to look at things like keywords or topics to find similar items. But with similarity search in Unbody, this isn't necessary. You can compare the whole document.

## Syntax

Expand Down Expand Up @@ -42,11 +42,9 @@ Find Google Docs that are similar to a specific Google Doc.
<Tabs size={"sm"} variant={"underlined"} className={"mt-2"}>
<Tab title={"Unbody SDK"}>
```javascript copy
unbody.get
.googleDoc
.search
.similar
.record("specificDocId");
const {
data: { payload }
} = unbody.get.googleDoc.similar.record("specificDocId").exec()
```
</Tab>
<Tab title={"GraphQL"}>
Expand All @@ -72,11 +70,9 @@ Find Google Docs that are similar to a specific Google Doc.
<Tabs size={"sm"} variant={"underlined"} className={"mt-2"}>
<Tab title={"Unbody SDK"}>
```javascript copy
unbody.get
.discordMessage
.search
.similar
.record("specificMessageId");
const {
data: { payload }
} = unbody.get.discordMessage.similar.record("specificMessageId").exec()

// payload is an array of DiscordMessages that are similar to the specific message with id "specificMessageId"
```
Expand All @@ -102,11 +98,9 @@ Find Google Docs that are similar to a specific Google Doc.
<Tabs size={"sm"} variant={"underlined"} className={"mt-2"}>
<Tab title={"Unbody SDK"}>
```javascript copy
unbody.get
.textBlock
.search
.similar
.record("specificTextBlockId");
const {
data: { payload }
} = unbody.get.textBlock.similar.record("specificTextBlockId").exec()

// payload is an array of textBlocks that are similar to the specific text block with id "specificTextBlockId"
// this search includes all types of objects available in the sources of your project
Expand Down
32 changes: 17 additions & 15 deletions pages/docs/api/search/semantic-search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ import {Tabs, Tab} from "@nextui-org/react";

Semantic search is a method that lets users search data based on the meaning of their query. Users can use any form of natural human language and still get the same results. This differs from classic search, which relies on exact keyword matching.

For instance, if you've got a collection of documents about Quentin Tarantino, Maradona, and Elon Musk, the user doesn't need to type the full term "Quentin Tarantino" to find documents about him. Instead, they can enter phrases like "a movie director" or "who made Pulp Fiction" and still reach the same results.
This method is best to use when you need to provide a more intuitive and user-friendly search experience, handle queries with ambiguity, or when you want to provide more relevant search results based on the context of the query.
| Feature | Lexical Search | Semantic Search |
|------------------------------|---------------------------------------------------|----------------------------------------------|
| **Definition** | Searches based on exact keyword matches. | Understands user intent and context behind queries. |
| **Search Method** | Matches terms exactly as they appear. | Interprets the meaning of the query. |
| **User Experience** | May miss relevant results if the wording differs. | Provides more relevant results based on user context. |
| **Use Cases** | Basic keyword searches in documents or databases. | Advanced searches in knowledge bases, FAQs, and recommendation systems. |

For example, if you search for "places to swim," a semantic search can show you information about "beaches," "pools," and "lakes," even if those specific terms aren’t in your search. This approach helps users find related content based on the overall meaning rather than just matching exact words.

## Syntax
You can perform semantic searches on virtually any text (`string`) field of any object. Here's how:
Expand Down Expand Up @@ -37,11 +43,9 @@ You can perform semantic searches on virtually any text (`string`) field of any
<Tabs size={"sm"} variant={"underlined"} className={"mt-2"}>
<Tab title={"Unbody SDK"}>
```javascript copy
unbody.get
.googleDoc
.search
.about("a movie director")

const {
data: { payload },
} = await unbody.get.googleDoc.search.about("a movie director").exec();
// payload is an array of GoogleDocs that are about "a movie director"
```
</Tab>
Expand All @@ -67,10 +71,9 @@ You can perform semantic searches on virtually any text (`string`) field of any
<Tabs size={"sm"} variant={"underlined"} className={"mt-2"}>
<Tab title={"Unbody SDK"}>
```javascript copy
unbody.get
.discordMessage
.search
.about("a movie director")
const {
data: { payload },
} = await unbody.get.discordMessage.search.about("a movie director").exec();

// payload is an array of DiscordMessages that are about "a movie director"
```
Expand All @@ -97,10 +100,9 @@ You can perform semantic searches on virtually any text (`string`) field of any
<Tabs size={"sm"} variant={"underlined"} className={"mt-2"}>
<Tab title={"Unbody SDK"}>
```javascript copy
unbody.get
.textBlock
.search
.about("a movie director")
const {
data: { payload },
} = await unbody.get.textBlock.search.about("a movie director").exec();

// payload is an array of textBlocks that are about "a movie director"
// this search includes all types of objects avaiable in the sources of your project
Expand Down
7 changes: 2 additions & 5 deletions pages/docs/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ import {PageCard} from "../../components/PageCard";
import {PageItems} from "../../components/PageItems";

# Get started with Unbody

Unbody is a platform that automates the entire backend development process you need to build AI-native applications or functionalities, in one API.

Unbody functions as a headless API, which grabs data from any location and in any format, and then processes it with your own choice of AI models, and then return the enhanced data to you via a GraphQL API or one of our SDKs.
Unbody automates the entire backend process needed to build AI-native applications or features, all through a single API. Acting as a headless API, Unbody seamlessly pulls data from any source, regardless of format, processes it using your choice of AI models, and delivers the enhanced data back to you via a GraphQL API or one of our SDKs.

## Before you begin
To get started, create an account with Unbody. You can [select the plan](https://unbody.io/pricing) that's right for you.
To get started, sign up for an Unbody account and [select the plan](https://unbody.io/pricing) that best fits your needs.

## Get started
The guide is divided into two chapters: the first chapter covers setting up Unbody and your project, while the second focuses on using the Unbody API.
Expand Down
26 changes: 20 additions & 6 deletions pages/docs/get-started/step-1-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,67 @@ import {Steps, Tabs, Callout} from "nextra/components";
import {PageCard} from "../../../components/PageCard";

# Setup Unbody

This step will happen all on [Unbody’s dashboard](https://app.unbody.io). Via the dashboard, you can manage anything about your account, subscription, projects, and more.
Manage all aspects of your Unbody account effortlessly through the [Unbody’s dashboard](https://app.unbody.io). From account settings and subscription management, projects and more, the dashboard provides you with complete control and flexibility in one seamless platform.

<Steps>
### Create a Project
To begin using Unbody for a project, you first need to create a project space 😀. Essentially, each project serves as a separate container for your data. If you're managing distinct datasets for two different websites, you'll need two separate projects. However, if you're utilizing the same datasets across multiple applications, a single project is sufficient. ([learn more](https://www.notion.so/Getting-started-7ea06be0e737441c8313a61d426ab53c?pvs=21))

![Create project](/images/docs/get-started/new-project.jpg)
On the dashboard homepage, click the "Create a new project" button. A dialogue will open where you need to name your project and set configurations for AI models and other features. You can either choose from one of the presets or navigate to the advanced panel for more flexibility. For this guide, select the `Generative OpenAI` preset. Click on `create project`. You'll automatically be redirected to the newly created project page.

1. On the dashboard homepage, click **Create a new project.**
2. Name your project and configure AI models and features in the dialogue box.
3. Choose a preset or go to the Advanced panel for more options.
4. For this guide, select the **Generative OpenAI** preset.
5. Click **create project** and you'll be redirected to the project page.

![project settings](/images/docs/get-started/project-settings.jpg)

### Add source(s)

You're now on the project page. Here, you can start adding data sources. A data source refers to the origin of your data (e.g., Google Drive, Discord Channel, or a Github Repository). Learn more about sources here. Click on "Add New Source" to open a dialog with four steps.
You're now on the project page. Here, you can start adding data sources. A data source refers to the origin of your data (e.g., Google Drive, Discord Channel, or a Github Repository). Learn more about sources [here]().
- Click on **Add New Source** to open a dialog with four steps.

![Create source](/images/docs/get-started/add-source.jpg)

<Steps>
### Select a provider

Choose the platform where your content is stored. For example, if it's stored in Google Drive, select it as the content provider. Visit [providers](docs/providers) for more information.
Choose the platform where your content is stored. For example, if it's stored in Google Drive, select it as the content provider. Visit [providers](/docs/providers/overview) for more information.

![Select provider](/images/docs/get-started/providers.jpg)

### Connect Unbody to your source

Allow Unbody to access your content from the selected provider. Learn more about this on [our privacy page](/privacy).

![Add a source source](/images/docs/get-started/connect.jpg)

### Set an entry point

Specify where Unbody should find your data on the chosen source. The entry points vary between source providers. For Google Drive, the entry point is a "folder," and for Discord, it's a "channel."

![Select an entrypoint](/images/docs/get-started/entry.jpg)

</Steps>

### Initialize Your Content

Navigate to next step and click "initialize". Unbody will index the content from your entry point. Once the process is completed, the dashboard will display the number of records processed.
Navigate to next step and click **initialize**. Unbody will index the content from your entry point. Once the process is completed, the dashboard will display the number of records processed.

![Initialize](/images/docs/get-started/init.jpg)

<Callout type="info">
Please note that the time taken to index your content depends on the size of your content. You can only start
interacting with your content once the indexing process is completed. Wait until the source status turns to idle and you see a certain number of records on your source card.
</Callout>

![Check build status](/images/docs/get-started/status.jpg)
</Steps>

## Next
Ready? let's move on to the next step.
<br />
<PageCard
title="Start building with Unbody"
description="Learn how to start building with Unbody."
Expand Down
7 changes: 6 additions & 1 deletion pages/docs/get-started/step-2-building.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import {Tab, Tabs} from "@nextui-org/react";
Unbody is essentially an API that primarily utilizes a GraphQL interface. To interact with Unbody, you can either use GraphQL queries directly or employ one of the SDKs provided. Access to any of the endpoints, whether through direct GraphQL queries or SDKs, requires an API key.

### Obtain an API key
Let's begin by creating an API key. Start from your dashboard and navigate to your project page. You'll see three tabs at the top labeled `sources`, `graphql`, and `settings`. Click on the `settings` tab to navigate to the settings page. Here, locate the `developer-settings` sub-page. This is where you can create an `API-key`.

1. Create an API key starting from your dashboard.
2. Click on the **project** you want to work with.
3. Click on the **Settings** tab at the top.
4. Click on the **Developer Settings** location on the sidebar.
5. Create your **API key** here.

Now, using this API key together with the `project-id` you can send requests to the API.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Accordion, AccordionItem, Tabs, Tab} from "@nextui-org/react";

# Make your first API call with Google Docs
Assuming you've already has gone through the [step 1](/docs/get-started/step-1-setup) and [step 2](/docs/get-started/step-2-setup), let's now make your first API call with Google Docs.
Assuming you've already has gone through the [step 1](/docs/get-started/step-1-setup) and [step 2](/docs/get-started/step-2-building), let's now make your first API call with Google Docs.

## Start with simple data-retrieving
Start by retrieving all `GoogleDoc` files from your source.
Expand Down
Loading