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

@basegrid-io/core

v1.1.0

Published

BaseGrid SDK - Memory Infrastructure for AI Agents | Sub-200ms Retrieval

Readme

@basegrid-io/core

npm version License

The official Node.js SDK for BaseGrid — persistent memory infrastructure for AI agents.

Sub-200ms memory retrieval. Hybrid semantic search. Built for production.


Installation

npm install @basegrid-io/core

Quick Start

import { BaseGrid } from '@basegrid-io/core';

const client = new BaseGrid({ apiKey: process.env.BASEGRID_API_KEY });

// Store a memory
await client.add({
  agentId: 'support-bot',
  content: 'User prefers concise answers and dislikes jargon',
});

// Search relevant memories
const memories = await client.search({
  agentId: 'support-bot',
  query: 'communication preferences',
  limit: 5,
});

console.log(memories);

Usage with AI Frameworks

With Vercel AI SDK

import { BaseGrid } from '@basegrid-io/core';
import { openai } from '@ai-sdk/openai';
import { generateText } from 'ai';

const client = new BaseGrid({ apiKey: process.env.BASEGRID_API_KEY });

// Retrieve context before generating
const memories = await client.search({ agentId: 'assistant', query: userMessage });
const context = memories.map(m => m.content).join('\n');

const { text } = await generateText({
  model: openai('gpt-4o'),
  prompt: `Context from memory:\n${context}\n\nUser: ${userMessage}`,
});

// Store the interaction
await client.add({ agentId: 'assistant', content: `User asked: ${userMessage}` });

With LangChain

import { BaseGrid } from '@basegrid-io/core';

const client = new BaseGrid({ apiKey: process.env.BASEGRID_API_KEY });

// Use as a memory layer in your chain
const relevantMemories = await client.search({
  agentId: 'langchain-agent',
  query: input,
});

API Reference

client.add(options)

Store a new memory.

const memory = await client.add({
  agentId: string,       // Required: namespace for this agent
  content: string,       // Required: the memory content
  metadata?: object,     // Optional: key-value metadata
  importance?: number,   // Optional: 0-1 (default: 0.5)
});

client.search(options)

Search memories using semantic similarity.

const memories = await client.search({
  agentId: string,   // Required: namespace to search
  query: string,     // Required: semantic search query
  limit?: number,    // Optional: max results (default: 5)
});

client.list(agentId, options?)

List all memories for an agent.

const result = await client.list('support-bot', {
  limit?: number,    // Optional: max results (default: 10)
  offset?: number,   // Optional: pagination offset
  search?: string,   // Optional: text search filter
});

client.delete(memoryId)

Delete a specific memory.

await client.delete('memory_id_here');

Data Management

client.update(memoryId, data)

Update an existing memory.

await client.update('memory_id', {
  content: 'Updated content',
  metadata: { key: 'value' },
});

client.bulkDelete(memoryIds)

Delete multiple memories at once.

await client.bulkDelete(['memory_1', 'memory_2', 'memory_3']);

client.deleteAgentMemories(agentId)

Delete all memories for an agent.

await client.deleteAgentMemories('support-bot');

client.exportAllData()

Export all your data (GDPR compliant).

const data = await client.exportAllData();

Retention Policies

client.getRetentionPolicies()

const policies = await client.getRetentionPolicies();

client.createRetentionPolicy(policy)

await client.createRetentionPolicy({
  agentId: 'support-bot',
  retentionDays: 90,
});

client.updateRetentionPolicy(id, updates)

await client.updateRetentionPolicy('policy_id', {
  retentionDays: 180,
});

client.deleteRetentionPolicy(id)

await client.deleteRetentionPolicy('policy_id');

Configuration

const client = new BaseGrid({
  apiKey: process.env.BASEGRID_API_KEY,  // Required
  baseUrl?: string,                       // Optional: default https://basegrid-production.up.railway.app
});

Pricing

| Plan | Memories | API Calls/Month | Price | |------|----------|-----------------|-------| | Free Trial | 500K | 1,000 | Free for 2 months | | Pro Starter | 500K | 5M | $49/month | | Pro Plus | 2M | 20M | $79/month | | Scale | 10M | 50M | $199/month |

Self-hosting available on Scale plan. Get your key at basegrid.io


Requirements


Other SDKs


Contributing

See CONTRIBUTING.md

License

Apache 2.0 — see LICENSE

Troubleshooting

Connection Refused Error

If you see connection refused errors, ensure you're using SDK version 1.0.1 or later:

npm install @basegrid-io/core@latest

Earlier versions may have used an incorrect default API endpoint.


Built by BaseGrid · Docs · Discord