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

@tekmemo/ai-sdk

v0.2.1

Published

Vercel AI SDK integration for TekMemo local, cloud, and hybrid memory runtimes.

Readme

@tekmemo/ai-sdk

Purpose

@tekmemo/ai-sdk makes TekMemo usable as a Vercel AI SDK tool with minimal glue code. It exposes helpers for:

  • creating an AI SDK-compatible memory tool
  • defining a ready-to-spread tools object
  • building a memory-aware system prompt
  • using local, cloud, or hybrid TekMemo runtimes behind the same API
  • enforcing project, user, conversation, and participant scope boundaries before memory is returned to the model
  • generating AgentFS session instructions for Codex, Claude Code, and AI SDK agents

AgentFS session instructions

Use this when an AI SDK-powered agent is working inside an AgentFS session created by @tekmemo/agentfs:

import { createTekMemoAgentSession } from "@tekmemo/agentfs";
import { buildAgentSessionInstructions } from "@tekmemo/ai-sdk";

const session = createTekMemoAgentSession({
  client: agentfsClient,
  memory: tekmemoStore,
  task: "Refactor auth middleware",
});

await session.prepare();

const system = buildAgentSessionInstructions({
  sessionId: session.sessionId,
  task: "Refactor auth middleware",
  paths: session.paths,
});

Install

npm install @tekmemo/ai-sdk ai tekmemo @tekmemo/fs

For hosted memory, also install @tekmemo/cloud-client and create a cloud runtime there.

Plug-and-play AI SDK usage

import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";
import { createNodeFsMemoryStore } from "@tekmemo/fs";
import {
  buildTekMemoSystemPrompt,
  createLocalAiSdkRuntime,
  defineTekMemoTools,
} from "@tekmemo/ai-sdk";

const workspace = createNodeFsMemoryStore({
  rootDir: process.cwd(),
  createRoot: true,
  missingFileBehavior: "empty",
});

const access = {
  projectId: "my-project",
  userId: "user_123",
  conversationId: "thread_456",
  actorId: "assistant:web",
};

const runtime = createLocalAiSdkRuntime({ workspace, access });
const { system } = await buildTekMemoSystemPrompt({
  runtime,
  access,
  query: "What should I remember before answering this request?",
  system: "You are a helpful product engineering assistant.",
});

const result = await generateText({
  model: openai("gpt-4.1-mini"),
  system,
  prompt: "Summarize the current implementation risks.",
  tools: defineTekMemoTools({
    runtime,
    access,
    allowWrites: true,
    allowCoreUpdates: false,
  }),
});

console.log(result.text);

The exported tool name is tekmemo_memory. To control the tool key yourself, use createTekMemoTool() directly:

import { createTekMemoTool } from "@tekmemo/ai-sdk";

const tools = {
  memory: createTekMemoTool({ runtime, access, allowWrites: true }),
};

Local convenience helpers

For local file-backed apps, createLocalTekMemoTool() and defineLocalTekMemoTools() create the local runtime and AI SDK tool in one call.

import { defineLocalTekMemoTools } from "@tekmemo/ai-sdk";

const tools = defineLocalTekMemoTools({
  workspace,
  access: { projectId: "my-project", userId: "user_123" },
  allowWrites: true,
});

Use the explicit runtime + defineTekMemoTools() form when you also need to call buildTekMemoSystemPrompt() with the same runtime.

Safety defaults

Writes are disabled unless allowWrites: true is passed. Core memory updates are disabled unless allowCoreUpdates: true is passed. Indexing is disabled unless allowIndexing: true is passed. Likely API keys and private keys are rejected by default unless allowSecrets: true is intentionally enabled.

Scope filtering is applied using the access object. User memory requires userId, conversation memory requires conversationId, and participant-shared memory requires participantIds.

Boundary

This package owns the AI SDK integration layer only. It does not own TekMemo Cloud billing, dashboards, tenancy, hosted database storage, or provider secrets.

For hosted memory, use @tekmemo/cloud-client. For local file-backed memory, use tekmemo with @tekmemo/fs. For MCP tools, use @tekmemo/mcp-server.

License

MIT.