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

poyraz

v1.2.0

Published

Embeddable AI agent library for Node.js: provider-agnostic chat, tool calling, MCP, context management and injectable policy. Every feature is opt-in.

Readme

Poyraz

The runtime behind your AI agents.

An embeddable Node.js library for tool-using agents, connected tools, and your choice of model provider.

npm version Node.js TypeScript License: MIT

Quick start · Features · Providers · Documentation · Changelog


Features

  • Build agents into your application. Connect a fluent builder and typed events to your backend, CLI, or desktop interface.
  • Choose cloud or local models. Use OpenAI, Groq, Gemini, OpenRouter, Ollama, llama.cpp, or your own provider implementation.
  • Connect your tools. Enable filesystem, shell, and search presets, define custom tools with schemas, or connect MCP servers.
  • Control agent execution. Configure tool allow-lists, response gates, error breakers, and continuation policies.
  • Stream the whole turn. Receive text, reasoning, tool activity, lifecycle updates, and usage events. Cancel with an AbortSignal.
  • Manage context and usage. Keep session history, enable summarization, inspect context usage, and calculate request costs with your configured token prices.
  • Opt in to runtime features. Enable repair guidance, bounded rate-limit waiting, and per-agent logging when your application needs them.

Built with TypeScript for Node.js. Powers agent execution in Xeck.

Your application stays in control. Poyraz takes prompts, credentials, policies, and MCP definitions from your host. It does not load .env files or create configuration directories.

Explore

Install · Tools and policy · Streaming · Providers · Develop


Quick start

Requires Node.js 20 or later. The package uses ES modules and includes TypeScript declarations.

npm install poyraz

Make OPENAI_API_KEY available in your application's environment, then create an agent:

import { AgentBuilder, openAiProfile, resolveApiKeyForProfile } from 'poyraz';

const profile = openAiProfile('gpt-4o-mini');
const apiKey = resolveApiKeyForProfile(profile, {
  openai: process.env.OPENAI_API_KEY,
});

const agent = new AgentBuilder()
  .Name('assistant')
  .WithModelProfile(profile)
  .ApiKey(apiKey)
  .Build();

await agent.init();

const { content } = await agent.chat('Say hello in one sentence.');
console.log(content);

This creates a minimal text agent. A fresh builder adds no system prompt, tools, summarization, logging, or rate-limit waiting. Model options are sent only when you configure them.

See Getting started for configuration examples and a provider stub you can run without an API key.

Add tools and policy

Extend the quick-start configuration with built-in tools and an explicit allow-list:

const workspaceAgent = new AgentBuilder()
  .WithModelProfile(profile)
  .ApiKey(apiKey)
  .SystemPrompt('Help the user understand their project files.')
  .WithPresets('filesystem', 'search')
  .Policy({ allowedTools: ['read_file', 'grep'] })
  .MaxToolRounds(10)
  .Build();

await workspaceAgent.init();
const { content } = await workspaceAgent.chat('Read package.json and summarize this project.');
console.log(content);

See Tools, Custom tools, and Agent policy for available tools and policy controls.

Stream a response

Use the agent from the quick start to receive text as it arrives:

await agent.chat('Explain what an agent runtime does.', {
  onEvent(event) {
    if (event.type === 'text.delta') {
      process.stdout.write(event.delta);
    }
  },
});

The same event interface exposes tool activity, context usage, and lifecycle changes. See Streaming for the full event reference and cancellation examples.

Providers

| Provider | Profile helper | | --- | --- | | OpenAI | openAiProfile | | Groq | groqProfile | | Google Gemini | geminiProfile | | OpenRouter | openRouterProfile | | Ollama | ollamaProfile | | llama.cpp | llamaCppProfile |

Model capabilities vary by provider and model. You can also inject a custom provider with .Provider(...) and switch model profiles at runtime.

See Auth and providers for credentials, local endpoints, model discovery, and provider-specific behavior.

Documentation

| Guide | Topics | | --- | --- | | Getting started | Installation, minimal agents, and opt-in configuration | | How it works | Runtime concepts and execution flow | | Agent API | Builder options, agent methods, and tool routing | | Tools · Custom tools | Built-in presets and application-specific tools | | Agent policy | Tool restrictions, response gates, and continuation | | MCP | Connecting external tool servers | | Streaming | Events, cancellation, and UI integration | | Context | History, summarization, and token metering | | Rate limits and logging | Retry budgets, logs, and debug output | | Evaluations | Running evaluations and comparing results | | API reference map | Public exports and their reference documentation |

Upgrading from an earlier release? See the 1.0 migration guide.

Development

Clone the repository and install the locked dependencies:

git clone https://github.com/Septillioner/poyraz.git
cd poyraz
npm ci
npm test
npm run build

Use npm run test:watch while developing or npm run test:coverage to generate a coverage report.

Contributing

For bug reports and feature requests, open an issue with the relevant configuration, reproduction steps, and expected behavior. For code changes, include a focused description and run the tests and build before opening a pull request.

Keep API keys and other secrets out of reports and commits.


Poyraz · Licensed under MIT

© 2026 Ege