npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ainative/langchain

v0.1.0

Published

LangChain.js integration for AINative — ChatModel, Embeddings, and VectorStore backed by AINative/ZeroDB. Free tier, auto-provisioning, OpenAI-compatible.

Downloads

19

Readme

@langchain/ainative

LangChain.js integration for AINative and ZeroDB. Chat models, embeddings, and vector store — all backed by AINative's free-tier AI infrastructure.

Zero config. Auto-provisions a free project on first use. No signup, no credit card.

Install

npm install @langchain/ainative @langchain/openai

Quick Start

Chat Model

import { AINativeChatModel } from '@langchain/ainative';

const model = new AINativeChatModel();
// Uses meta-llama/Llama-3.3-70B-Instruct by default (free tier)

const response = await model.invoke('What is retrieval-augmented generation?');
console.log(response.content);

Embeddings

import { AINativeEmbeddings } from '@langchain/ainative';

const embeddings = new AINativeEmbeddings();
// Uses BAAI/bge-small-en-v1.5 by default (free tier)

const vectors = await embeddings.embedDocuments([
  'Hello world',
  'LangChain is great',
]);
console.log(vectors[0].length); // 384

Vector Store (RAG)

import { AINativeChatModel, AINativeEmbeddings, AINativeVectorStore } from '@langchain/ainative';

// Create embeddings + vector store
const embeddings = new AINativeEmbeddings();
const vectorStore = new AINativeVectorStore(embeddings, {
  // Optional: auto-provisions if omitted
  apiKey: process.env.ZERODB_API_KEY,
  projectId: process.env.ZERODB_PROJECT_ID,
});

// Add documents
await vectorStore.addDocuments([
  { pageContent: 'AINative provides free LLM access.', metadata: { source: 'docs' } },
  { pageContent: 'ZeroDB is a vector database for AI agents.', metadata: { source: 'docs' } },
]);

// Similarity search
const results = await vectorStore.similaritySearch('free AI tools', 3);
console.log(results);

Full RAG Chain

import { AINativeChatModel, AINativeEmbeddings, AINativeVectorStore } from '@langchain/ainative';
import { StringOutputParser } from '@langchain/core/output_parsers';
import { ChatPromptTemplate } from '@langchain/core/prompts';
import { RunnableSequence } from '@langchain/core/runnables';

const model = new AINativeChatModel();
const embeddings = new AINativeEmbeddings();
const vectorStore = new AINativeVectorStore(embeddings);

// Build RAG chain
const retriever = {
  invoke: async (query) => {
    const docs = await vectorStore.similaritySearch(query, 3);
    return docs.map((d) => d.pageContent).join('\n');
  },
};

const prompt = ChatPromptTemplate.fromTemplate(
  'Answer based on context:\n{context}\n\nQuestion: {question}'
);

const chain = RunnableSequence.from([
  {
    context: (input) => retriever.invoke(input.question),
    question: (input) => input.question,
  },
  prompt,
  model,
  new StringOutputParser(),
]);

const answer = await chain.invoke({ question: 'What is ZeroDB?' });
console.log(answer);

Configuration

Chat Model Options

| Option | Default | Description | |--------|---------|-------------| | model | meta-llama/Llama-3.3-70B-Instruct | Model name | | apiKey | process.env.AINATIVE_API_KEY | AINative API key | | baseURL | https://api.ainative.studio/api/v1 | API base URL | | temperature | 0.7 | Sampling temperature | | maxTokens | - | Max tokens in response |

Embeddings Options

| Option | Default | Description | |--------|---------|-------------| | model | BAAI/bge-small-en-v1.5 | Embedding model | | apiKey | process.env.AINATIVE_API_KEY | AINative API key | | baseURL | https://api.ainative.studio/api/v1 | API base URL |

Vector Store Options

| Option | Default | Description | |--------|---------|-------------| | apiKey | process.env.ZERODB_API_KEY | ZeroDB API key | | projectId | process.env.ZERODB_PROJECT_ID | ZeroDB project ID | | namespace | default | Vector namespace | | baseURL | https://api.ainative.studio | API base URL |

Auto-Provisioning

When no API key is provided, the package automatically creates a free ZeroDB project:

  1. Makes a POST to /api/v1/public/instant-db
  2. Returns credentials (API key + project ID)
  3. Project has a 72-hour trial — claim it at the provided URL to keep permanently

Set ZERODB_API_KEY and ZERODB_PROJECT_ID environment variables to skip provisioning.

Environment Variables

| Variable | Description | |----------|-------------| | AINATIVE_API_KEY | API key for chat/embeddings | | ZERODB_API_KEY | API key for vector store | | ZERODB_PROJECT_ID | ZeroDB project ID |

CommonJS Support

const { AINativeChatModel, AINativeEmbeddings, AINativeVectorStore } = require('@langchain/ainative');

License

MIT