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

axicov-sdk

v1.2.2

Published

SDK for creating and managing AI agents with tools

Downloads

142

Readme

Axicov SDK

A powerful SDK for creating and managing AI agents with tools using LangChain

Installation

npm install axicov-sdk

Requirements

  • Node.js 16 or higher
  • API keys for one of the supported AI models (Anthropic or Google Gemini)
  • MongoDB (optional, for persistent state)

Environment Variables

Create a .env file with the following variables:

# Choose one of these API keys
ANTHROPIC_API_KEY=your_anthropic_api_key
GEMINI_API_KEY=your_gemini_api_key

# Optional for MongoDB checkpoint storage
MONGO_URI=your_mongodb_connection_string

Basic Usage

import { Agent } from "axicov-sdk";

// Define your tools
const myTools = [
  // Tool definitions here
];

const coreRegistry = [
  // Core tool registry functions
];

const allRegistry = [
  // All available tool registry functions
];

// Create agent
const agent = new Agent({
  threadId: "unique-thread-id",
  params: {
    name: "MyAssistant",
    instruction: "Help the user with their tasks",
    publicKey: "optional-public-key",
    // Add any persistent parameters that should be stored in DB
  },
});

// Initialize agent with tools
await agent.initialize({
  toolNumbers: [0, 1, 2], // Indexes of tools to use
  coreRegistry,
  allRegistry,
  checkPointer: "local", // or 'mongo' for MongoDB storage
});

// Runtime parameters can be set after initialization
agent.runtimeParams = {
  currentSession: "session-123",
  temporaryData: {
    /* any session-specific data */
  },
  // Add any runtime-generated data that doesn't need persistence
};

// Send messages to the agent
const response = await agent.messageAgent("Hello, can you help me?");
console.log(response);

Agent Parameters

The Agent class uses two different parameter objects:

  1. params: Used for persistent data that should be stored in a database and retrieved when recreating the agent.

    • Set during agent creation
    • Contains configuration like name, instructions, public keys
    • Should include any data needed to reconstruct the agent's state
  2. runtimeParams: Used for temporary data generated during execution.

    • Set during runtime
    • Contains session-specific information
    • Not meant for persistent storage
    • Useful for passing context between tool calls

Example Use Case

// Persistent parameters (stored in DB)
const agent = new Agent({
  threadId: 'user-123',
  params: {
    name: 'Finance Assistant',
    instruction: 'Help with financial tasks',
    userId: 'user-123',
    preferences: {
      language: 'en',
      currency: 'USD',
      timezone: 'America/New_York'
    }
  }
});

// Runtime parameters (generated during execution)
agent.runtimeParams = {
  sessionStartTime: Date.now(),
  lastActivity: Date.now(),
  currentOperation: 'portfolio-analysis',
  tempData: {
    calculationResults: {...},
    userInputCache: {...}
  }
};

Creating Custom Tools

You can create custom tools for your agent using the following pattern:

import { DynamicStructuredTool } from "@langchain/core/tools";
import { z } from "zod";
import { Agent, Tools } from "axicov-sdk";

export const customToolRegistry = async (agent: Agent) => {
  const tools: any = [];
  const schema: Tools = {};

  // Define your tool schema first
  schema.yourToolKey = {
    name: "toolName",
    description: "Description of what your tool does",
    schema: z.object({
      paramName: z.string().describe("Description of this parameter"),
      // Add more parameters as needed
    }),
    requiresApproval: false, // Set to true if the tool needs approval before use
  };

  // Create the tool using the schema
  const customTool = new DynamicStructuredTool({
    name: schema.yourToolKey.name,
    description: schema.yourToolKey.description,
    schema: schema.yourToolKey.schema,
    func: async ({ paramName }) => {
      // Implement your tool's functionality here
      console.log(`Processing: ${paramName}`);

      // Return the result
      return "Tool result";
    },
  });

  // Add the tool to the tools array
  tools.push(customTool);

  // Return both the tools array and schema
  return {
    tools,
    schema,
  };
};

Example: Price Lookup Tool

Here's a practical example of a tool that fetches prices for different countries:

import { DynamicStructuredTool } from "@langchain/core/tools";
import { z } from "zod";
import { Agent, Tools } from "axicov-sdk";

export const priceToolRegistry = async (agent: Agent) => {
  const tools: any = [];
  const schema: Tools = {};

  // Sample data
  const prices: { [key: string]: number } = {
    USA: 3.99,
    Japan: 450,
    Germany: 2.5,
    Brazil: 8.75,
  };

  // Define the tool schema
  schema.priceInfo = {
    name: "getPrices",
    description: "A tool that fetches price of products in different countries",
    schema: z.object({
      country: z.string().describe("The country to get prices for"),
      product: z
        .string()
        .optional()
        .describe("Optional specific product to check"),
    }),
    requiresApproval: false,
  };

  // Create the tool
  const priceTool = new DynamicStructuredTool({
    name: schema.priceInfo.name,
    description: schema.priceInfo.description,
    schema: schema.priceInfo.schema,
    func: async ({ country, product }) => {
      console.log(
        `Looking up prices for ${product || "all products"} in ${country}`
      );

      if (prices[country]) {
        return `Price in ${country}: ${prices[country]}`;
      } else {
        return `Price information for ${country} is not available.`;
      }
    },
  });

  tools.push(priceTool);

  return {
    tools,
    schema,
  };
};

License

ISC