0.0.26 • Published 8 months ago

vector-ai v0.0.26

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

Vector AI

Vector AI is a powerful, easy-to-use library for generating embeddings and using semantic search to identify patterns. It is designed to work seamlessly with modern JavaScript and TypeScript codebases.

Features

  • Intuitive API for creating vector embeddings and query matching vector databases
  • Support for async operations
  • Compatible with both JavaScript and TypeScript

Installation

You can install Vector AI via npm:

npm install vector-ai

Or with Yarn:

yarn add vector-ai

Usage

Here's a quick example of how you can use Vector AI:

import { VectorClient } from "vector-ai";

const client = new VectorClient({
  apiKey: "",
  dbUrl: "",
  model: "gpt-3.5-turbo", // gpt-4
  template: "Your role...",
  temperature: 0.8,
  chunkSize?: 500,
  chunkOverlap?: 100,
});

const question = "What is the capital of France?";

// Create embeddings
const embeddings = await client create.embeddings(question);

// Query embeddings
const context = await client.queryEmbeddings(embeddings, "<db function name>"); // e.g., 'match_documents'

// Get answer
const answer = await client.getAnswer(question, context);

Data Ingestion

const client = new VectorClient({
  apiKey: "",
  dbUrl: "",
  model: "gpt-3.5-turbo", // gpt-4
  template: "Your role...",
  temperature: 0.8,
  chunkSize?: 500,
  chunkOverlap?: 100,
});
let data = "";
try {
  data = await fs.readFile("test.txt", "utf-8");
} catch (error) {
  console.log(error);
}
try {
  // data and table to insert to
  await client.ingestData(data, "documents");
} catch (error) {
  console.log(error);
}

Contributing

We welcome contributions to Vector AI! Please see our contributing guide for more details.

License

Vector AI is MIT licensed.

0.0.26

8 months ago

0.0.25

8 months ago

0.0.24

10 months ago

0.0.23

10 months ago

0.0.22

10 months ago

0.0.21

10 months ago

0.0.20

10 months ago

0.0.19

10 months ago

0.0.18

10 months ago

0.0.17

10 months ago

0.0.16

10 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago