Skip to content

Commit

Permalink
Merge pull request Ironclad#176 from a-rothwell/arothwell/add-vector-…
Browse files Browse the repository at this point in the history
…docs

add vector store docs and clean node display
  • Loading branch information
abrenneke authored Sep 28, 2023
2 parents 7b59ef9 + e986fe2 commit 36cfe27
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 14 deletions.
15 changes: 3 additions & 12 deletions packages/core/src/model/nodes/VectorNearestNeighborsNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ export class VectorNearestNeighborsNodeImpl extends NodeImpl<VectorNearestNeighb
});
}

if (this.data.useCollectionIdInput) {
inputDefinitions.push({
id: 'collectionId' as PortId,
title: 'Collection ID',
dataType: 'string',
required: true,
});
}

return inputDefinitions;
}

Expand Down Expand Up @@ -137,9 +128,9 @@ export class VectorNearestNeighborsNodeImpl extends NodeImpl<VectorNearestNeighb

getBody(): string | undefined {
return dedent`
${this.data.useIntegrationInput ? '(Integration using input)' : this.data.integration}
k: ${this.data.useKInput ? '(using input)' : this.data.k}
${this.data.useCollectionIdInput ? '(using input)' : this.data.collectionId}
Integration: ${this.data.useIntegrationInput ? '(using input)' : this.data.integration}
K: ${this.data.useKInput ? '(using input)' : this.data.k}
Collection Id: ${this.data.useCollectionIdInput ? '(using input)' : this.data.collectionId}
`;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/model/nodes/VectorStoreNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ export class VectorStoreNodeImpl extends NodeImpl<VectorStoreNode> {

getBody(): string | undefined {
return dedent`
${this.data.useIntegrationInput ? '(Integration using input)' : this.data.integration}
${this.data.useCollectionIdInput ? '(using input)' : this.data.collectionId}
Integration: ${this.data.useIntegrationInput ? '(using input)' : this.data.integration}
Collection Id: ${this.data.useCollectionIdInput ? '(using input)' : this.data.collectionId}
`;
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions packages/docs/docs/node-reference/vector-knn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,59 @@ title: 'Vector Nearest Neighbors'
---

# Vector Nearest Neighbors Node

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

## Overview

The Vector KNN Node takes a vector embedding and searches for K similar vectors.

![Chat Node Screenshot](./assets/vector-knn-node.png)

<Tabs
defaultValue="inputs"
values={[
{label: 'Inputs', value: 'inputs'},
{label: 'Outputs', value: 'outputs'},
{label: 'Editor Settings', value: 'settings'},
]
}>

<TabItem value="inputs">

## Inputs

| Title | Data Type | Description | Required | |
| ------ | ----------- | ----------------------------------------------------------- | -------- |
| Vector | vector | The vector you would like to search for nearest neighbors. | True |
</TabItem>

<TabItem value="outputs">

## Outputs

| Title | Data Type | Description |
| -------- | --------- | ----------------------------- |
| Results | any[] | Array of nearest K neighbors. |

</TabItem>

<TabItem value="settings">

## Editor Settings

| Setting | Description |
| --------------- | -------------------------------------- |
| Integration | Which integrated store to use. |
| K | Number of nearest neighbors to return. |
| Collection Id | Which collection to store the vector. |


</TabItem>

</Tabs>

## See Also

- [Pinecone](../user-guide/plugins/built-in/pinecone.md)
57 changes: 57 additions & 0 deletions packages/docs/docs/node-reference/vector-store.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,60 @@ title: 'Vector Store'
---

# Vector Store Node

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

## Overview

The Vector Store Node takes a vector embedding and stores it in a vector store. The vector store can then be used to perform similarity searches.

![Chat Node Screenshot](./assets/vector-store-node.png)

<Tabs
defaultValue="inputs"
values={[
{label: 'Inputs', value: 'inputs'},
{label: 'Outputs', value: 'outputs'},
{label: 'Editor Settings', value: 'settings'},
]
}>

<TabItem value="inputs">

## Inputs

| Title | Data Type | Description | Required | |
| ------ | ----------- | ------------------------------------------------ | -------- |
| Vector | vector | The vector you would like to store. | True |
| Data | any | Metadata you would like to store with the vector. | True |
| Id | string | The vectors unique id. | True |
</TabItem>

<TabItem value="outputs">

## Outputs

| Title | Data Type | Description |
| -------- | --------- | ------------------------------------------------- |
| Complete | boolean | Returns True if the store completes successfully. |

</TabItem>

<TabItem value="settings">

## Editor Settings

| Setting | Description |
| --------------- | ------------------------------------ |
| Integration | Which integrated store to use. |
| Collection Id | Which collection to store the vector.|


</TabItem>

</Tabs>

## See Also

- [Pinecone](../user-guide/plugins/built-in/pinecone.md)
3 changes: 3 additions & 0 deletions packages/docs/docs/user-guide/plugins/built-in/all.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ The available built-in plugins are:
- [Anthropic](./anthropic.md)
- [AssemblyAI](./assemblyai.md)
- [Autoevals](./autoevals.md)
- [Gentrace](./gentrace.md)
- [HuggingFace](./huggingface.md)
- [Pinecone](./pinecone.md)

See each plugin's corresponding documentation for more information.
5 changes: 5 additions & 0 deletions packages/docs/docs/user-guide/plugins/built-in/huggingface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_label: Hugging Face
---

# Hugging Face Plugin
5 changes: 5 additions & 0 deletions packages/docs/docs/user-guide/plugins/built-in/pinecone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_label: Pinecone
---

# Pinecone Plugin
2 changes: 2 additions & 0 deletions packages/docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ const sidebars = {
'user-guide/plugins/built-in/assemblyai',
'user-guide/plugins/built-in/autoevals',
'user-guide/plugins/built-in/gentrace',
'user-guide/plugins/built-in/huggingface',
'user-guide/plugins/built-in/pinecone'
],
},
{
Expand Down

0 comments on commit 36cfe27

Please sign in to comment.