Skip to content

npm package to easily ingest and query data using a vector db and LLM

Notifications You must be signed in to change notification settings

AnonJon/vector-ai-npm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: "",
  model: "",
  dbUrl: ""
});

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>");

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

Data Ingestion

const client = new VectorClient({
  apiKey: "",
  model: "gpt-3.5-turbo",
  dbUrl: "",
});
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.

About

npm package to easily ingest and query data using a vector db and LLM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published