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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@verida/personalagentkit-langchain

v0.1.0

Published

Langchain Toolkit extension of Verida PersonalAgentkit

Downloads

5

Readme

Verida PersonalAgentkit

PersonalAgentKit is a framework for easily enabling AI agents to access private user data. It is designed to be framework-agnostic.

Table of Contents

Getting Started

Prerequisites:

Installation

yarn install @verida/personalagentkit

Usage

Create a PersonalAgentKit instance.

Cnfiguration:

  • Set VERIDA_API_KEY environment variable [REQUIRED]
  • Set VERIDA_API_ENDPOINT environment variable [OPTIONAL]
  import { PersonalAgentKit, PersonalAgentKitOptions } from "@verida/personalagentkit";

  // Initialize AgentKit
  const personalAgentkit = await PersonalAgentKit.from(<PersonalAgentKitOptions>{
    veridaApiKey: process.env.VERIDA_API_KEY,
    veridaApiEndpoint: process.env.VERIDA_API_ENDPOINT || undefined,
  });

Use the agent's actions with a framework extension. For example, using LangChain + OpenAI.

Configuration:

  • Set OPENAI_API_KEY environment variable to your LLM API Key [REQUIRED]
  • Set OPENAI_MODEL environment variable [OPTIONAL]
  • Set OPENAI_BASE_URL environment variable [OPTIONAL]
yarn install @langchain @langchain/langgraph @langchain/openai
  import { ChatOpenAI } from "@langchain/openai";
  import { MemorySaver } from "@langchain/langgraph";
  import { createReactAgent } from "@langchain/langgraph/prebuilt";

  // Initialize LLM
  const llm = new ChatOpenAI({
    model: process.env.OPENAI_MODEL ? process.env.OPENAI_MODEL : undefined,
    apiKey: process.env.OPENAI_API_KEY,
    configuration: {
      baseURL: process.env.OPENAI_BASE_URL ? process.env.OPENAI_BASE_URL : undefined,
    },
  });

  // Store buffered conversation history in memory
  const memory = new MemorySaver();
  const agentConfig = {
    configurable: { thread_id: "PersonalAgentKit Chatbot Example" },
  };

  // Create React Agent using the LLM and Verida PersonalAgentKit tools
  const agent = createReactAgent({
    llm,
    tools,
    checkpointSaver: memory,
    messageModifier: `
        You are a helpful agent that has access to the user's data via the Verida PersonalAgentKit. You are empowered to query user data to provide personalized responses and learn more about the user. If someone asks you to do something you can't do with your currently available tools, you must say so. Be concise and helpful with your responses. Refrain from restating your tools' descriptions unless it is explicitly requested.
        `,
  });

Make a LLM request with access to user data

  import { HumanMessage } from "@langchain/core/messages";
  
  const userInput = "Summarize and prioritize my last 24 hours of messages"
  const stream = await agent.stream({ messages: [new HumanMessage(userInput)] }, agentConfig);

  for await (const chunk of stream) {
    if ("agent" in chunk) {
      console.log(chunk.agent.messages[0].content);
    }
  }