# mindplug

> Embeddings made easy with mindplug

Latest version **1.0.18** (published 2024-03-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install mindplug
pnpm add mindplug
yarn add mindplug
bun add mindplug
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.18 |
| Published | 2024-03-28 |
| First published | 2023-08-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 31.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Amritpal |
| Maintainers | cheraamritpal |

## Links

- npm: https://www.npmjs.com/package/mindplug
- npm.io page: https://npm.io/package/mindplug

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^1.4.0
- [openai](https://npm.io/package/openai.md) ^3.3.0
- [bottleneck](https://npm.io/package/bottleneck.md) ^2.19.5

## Recent versions

- 1.0.18 (latest) — 2024-03-28
- 1.0.17 — 2024-03-28
- 1.0.16 — 2024-03-28
- 1.0.15 — 2024-03-28
- 1.0.14 — 2024-03-28
- 1.0.13 — 2023-10-19
- 1.0.12 — 2023-10-17
- 1.0.11 — 2023-10-17
- 1.0.10 — 2023-10-17
- 1.0.9 — 2023-10-02
- 1.0.8 — 2023-10-02
- 1.0.7 — 2023-08-11
- 1.0.6 — 2023-08-11
- 1.0.5 — 2023-08-11
- 1.0.4 — 2023-08-11
- … 4 more at https://npm.io/package/mindplug/versions

## README

## <a href="https://mindplug.io" target="blank" rel="noreferrer, noopener">Mindplug</a> 
Mindplug is the easiest solution to creating and managing embeddings. Add long term memory to your LLMs, perform semantic data analysis and easily filter data based on metadata. Connect your app to external web sources using our smart endpoint.

### Install Mindplug
NPM:
```
npm install mindplug
```
yarn:
```
yarn add mindplug
```
<br/>

### Initialize Mindplug
Obtain an API key from <a href="https://mindplug.io" target="blank" rel="noreferrer, noopener">Mindplug</a>  dashboard.
```
import Mindplug from 'mindplug';
const mindplug = new Mindplug({mindplugKey: <SAMPLE KEY>});
```
<br />


### Store data
#### All storage of data requires a db and a collection.
Store text. Requires content
```
mindplug.store({
  db: "first database",
  collection: "any collection",
  content: "hello, sample text to store",
});
```
Store PDF file. Requires an object of type File under 20MB
```
mindplug.storePDF({
  db: "first database",
  collection: "any collection",
  file: <SAMPLE FILE>
});
```
Store Webpage. Requires the webpage url
```
mindplug.storeWeb({
  db: "first database",
  collection: "any collection",
  url: "https://mindplug.io"
});
```
Store audio. Requires a MP3 or WAV file under 20MB
```
// must pass an openaiKey to constructor
mindplug.storeAudio({
  db: "first database",
  collection: "any collection",
  file: <SAMPLE FILE> 
});
```
#### Storing - Advanced Techniques
A `metadata` of type JSON and a `chunkSize` of type number may also be passed to each storage function. Metadata is used to easily filter for data. Chunksize is used to split large data into smaller batches. By default the data is split in about 1024 character chunks.
```
mindplug.store({
  db: "first database",
  collection: "any collection",
  content: "hello, sample text to store",
  metadata: {
    purpose: "to learn"
  },
  chunkSize: 512
});
```

### Query data
Semantic search. Search stored data by meaning of text.
```
mindplug.query({
  db: "first database",
  collection: "any collection",
  search: "What fruit is in the fridge?"
});
```

Query by vector ids.
```
mindplug.queryByIds({
  db: "first database",
  collection: "any collection",
  vectorIds: ["ID-1", "ID-2"]
});
```

Query by collection. Returns the recent 10 vectors from the collection.
```
mindplug.queryByCollection({
  db: "first database",
  collection: "any collection"
});
```
#### Query - Advanced Techniques
By default, mindplug returns the 3 best matches for the searched data. You can change this by passing a `count` parameter. You can also filter the stored data based on metadata by passing in a `metadataFilters` parameter.
```
mindplug.query({
  db: "first database",
  collection: "any collection",
  search: "What are the benefits of Solana blockchain?",
  metadataFilters: {
    genre: ["technology", "blockchain"]
  },
  count: 1
});
```
For more information on using metadataFilters, please see our API <a href="https://docs.mindplug.io/api/query/using-metadata-filters" target="blank" rel="noreferrer, noopener">documentation</a>


### Delete data
Delete by vector ids.
```
mindplug.deleteByIds({
  db: "first database",
  collection: "any collection",
  vectorIds: ["ID-1", "ID-2"]
});
```
Delete by upload id. Upload id is returned every time new data is stored
```
mindplug.deleteByUploadId({
  db: "first database",
  collection: "any collection",
  uploadId: "UPLOAD-ID"
});
```
Delete collection. Also deletes all vectors stored within.
```
mindplug.deleteCollection({
  db: "first database",
  collection: "any collection"
});
```
Delete project. Also deletes all collections and vectors stored within.
```
mindplug.deleteProject({
  db: "first database"
});
```
### List data
List Collections.
```
mindplug.listCollections({
  db: "first database"
});
```
List projects.
```
mindplug.listProjects();
```

### Smart
Google search from select sources.
```
mindplug.searchWeb({
  search: "How to cook pasta?"
});
```
### About
Mindplug is developed by the team at Bored Labs, the parent company of the team behind <a href="https://experai.com" target="blank" rel="noreferrer, noopener">ExperAI</a>, a chatbot application where you can interact with any AI expert instantly. 

The experts of ExperAI use mindplug for long term memory and data analysis. We've proven to support production level applications with great reliability. Our goal is to provide the easiest solution to semantic search. To support our goal, we've also built a <a href="https://mindplug.io" target="blank" rel="noreferrer, noopener">frontend app</a> for Mindplug to allow users to interact with embeddings with no code. We keep it boring :)# mindplug-js-sdk

---
_Source: https://npm.io/package/mindplug · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
