Home

Awesome

<p align="center"> <a href="https://agentic.so"> <img alt="Agentic" src="/docs/media/agentic-header.jpg" width="308"> </a> </p> <p align="center"> <em>AI agent stdlib that works with any LLM and TypeScript AI SDK.</em> </p> <p align="center"> <a href="https://github.com/transitive-bullshit/agentic/actions/workflows/main.yml"><img alt="Build Status" src="https://github.com/transitive-bullshit/agentic/actions/workflows/main.yml/badge.svg" /></a> <a href="https://www.npmjs.com/package/@agentic/stdlib"><img alt="NPM" src="https://img.shields.io/npm/v/@agentic/stdlib.svg" /></a> <a href="https://github.com/transitive-bullshit/agentic/blob/main/license"><img alt="MIT License" src="https://img.shields.io/badge/license-MIT-blue" /></a> <a href="https://prettier.io"><img alt="Prettier Code Formatting" src="https://img.shields.io/badge/code_style-prettier-brightgreen.svg" /></a> </p>

Agentic <!-- omit from toc -->

Intro

Agentic is a standard library of AI functions / tools which are optimized for both normal TS-usage as well as LLM-based usage. Agentic works with all of the major TS AI SDKs (LangChain, LlamaIndex, Vercel AI SDK, OpenAI SDK, etc).

Agentic clients like WeatherClient can be used as normal TS classes:

import { WeatherClient } from '@agentic/stdlib'

// Requires `process.env.WEATHER_API_KEY` (free from weatherapi.com)
const weather = new WeatherClient()

const result = await weather.getCurrentWeather({
  q: 'San Francisco'
})
console.log(result)

Or you can use these clients as LLM-based tools where the LLM decides when and how to invoke the underlying functions for you.

This works across all of the major AI SDKs via adapters. Here's an example using Vercel's AI SDK:

// sdk-specific imports
import { openai } from '@ai-sdk/openai'
import { generateText } from 'ai'
import { createAISDKTools } from '@agentic/ai-sdk'

// sdk-agnostic imports
import { WeatherClient } from '@agentic/stdlib'

const weather = new WeatherClient()

const result = await generateText({
  model: openai('gpt-4o-mini'),
  // this is the key line which uses the `@agentic/ai-sdk` adapter
  tools: createAISDKTools(weather),
  toolChoice: 'required',
  prompt: 'What is the weather in San Francisco?'
})

console.log(result.toolResults[0])

You can use our standard library of thoroughly tested AI functions with your favorite AI SDK – without having to write any glue code!

Here's a slightly more complex example which uses multiple clients and selects a subset of their functions using the AIFunctionSet.pick method:

// sdk-specific imports
import { ChatModel, createAIRunner } from '@dexaai/dexter'
import { createDexterFunctions } from '@agentic/dexter'

// sdk-agnostic imports
import { PerigonClient, SerperClient } from '@agentic/stdlib'

async function main() {
  // Perigon is a news API and Serper is a Google search API
  const perigon = new PerigonClient()
  const serper = new SerperClient()

  const runner = createAIRunner({
    chatModel: new ChatModel({
      params: { model: 'gpt-4o-mini', temperature: 0 }
    }),
    functions: createDexterFunctions(
      perigon.functions.pick('search_news_stories'),
      serper
    ),
    systemMessage: 'You are a helpful assistant. Be as concise as possible.'
  })

  const result = await runner(
    'Summarize the latest news stories about the upcoming US election.'
  )
  console.log(result)
}

Docs

Full docs are available at agentic.so.

AI SDKs

Vercel AI SDK

Agentic adapter docs for the Vercel AI SDK

LangChain

Agentic adapter docs for LangChain

LlamaIndex

Agentic adapter docs for LlamaIndex

Firebase Genkit

Agentic adapter docs for Genkit

Dexa Dexter

Agentic adapter docs for Dexter

OpenAI

Agentic adapter docs for OpenAI

GenAIScript

Agentic support in GenAIScript

Tools

Service / ToolPackageDocsDescription
Bing@agentic/bingdocsBing web search.
Calculator@agentic/calculatordocsBasic calculator for simple mathematical expressions.
Clearbit@agentic/clearbitdocsResolving and enriching people and company data.
Dexa@agentic/dexadocsAnswers questions from the world's best podcasters.
Diffbot@agentic/diffbotdocsWeb page classification and scraping; person and company data enrichment.
E2B@agentic/e2bdocsHosted Python code interpreter sandbox which is really useful for data analysis, flexible code execution, and advanced reasoning on-the-fly.
Exa@agentic/exadocsWeb search tailored for LLMs.
Firecrawl@agentic/firecrawldocsWebsite scraping and structured data extraction.
HackerNews@agentic/hacker-newsdocsOfficial HackerNews API.
Hunter@agentic/hunterdocsEmail finder, verifier, and enrichment.
Jina@agentic/jinadocsURL scraper and web search.
Midjourney@agentic/midjourneydocsUnofficial Midjourney client for generative images.
Novu@agentic/novudocsSending notifications (email, SMS, in-app, push, etc).
People Data Labs@agentic/people-data-labsdocsPeople & company data (WIP).
Perigon@agentic/perigondocsReal-time news API and web content data from 140,000+ sources. Structured and enriched by AI, primed for LLMs.
Polygon@agentic/polygondocsStock market and company financial data.
PredictLeads@agentic/predict-leadsdocsIn-depth company data including signals like fundraising events, hiring news, product launches, technologies used, etc.
Proxycurl@agentic/proxycurldocsPeople and company data from LinkedIn & Crunchbase.
Searxng@agentic/searxngdocsOSS meta search engine capable of searching across many providers like Reddit, Google, Brave, Arxiv, Genius, IMDB, Rotten Tomatoes, Wikidata, Wolfram Alpha, YouTube, GitHub, etc.
SerpAPI@agentic/serpapidocsLightweight wrapper around SerpAPI for Google search.
Serper@agentic/serperdocsLightweight wrapper around Serper for Google search.
Slack@agentic/slackdocsSend and receive Slack messages.
SocialData@agentic/social-datadocsUnofficial Twitter / X client (readonly) which is much cheaper than the official Twitter API.
Tavily@agentic/tavilydocsWeb search API tailored for LLMs.
Twilio@agentic/twiliodocsTwilio conversation API to send and receive SMS messages.
Twitter@agentic/twitterdocsBasic Twitter API methods for fetching users, tweets, and searching recent tweets. Includes support for plan-aware rate-limiting. Uses Nango for OAuth support.
Weather@agentic/weatherdocsBasic access to current weather data based on location.
Wikidata@agentic/wikidatadocsBasic Wikidata client.
Wikipedia@agentic/wikipediadocsWikipedia page search and summaries.
Wolfram Alpha@agentic/wolfram-alphadocsWolfram Alpha LLM API client for answering computational, mathematical, and scientific questions.

For more details, see the docs.

Contributors

License

MIT © Travis Fischer

To stay up to date or learn more, follow @transitive_bs on Twitter.