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

kata-context

v0.2.0

Published

A standalone context policy engine for AI agents

Readme

Kata Context

Status: v0.2.0 (Database + Storage Layer) — Storage foundation complete. Building in public.

What This Is

Kata Context is a standalone context policy engine for AI agents. It manages what goes in and out of the LLM context window — handling compaction, summarization, retrieval, and budget-aware windowing. Framework-agnostic: works with any agent system, or none.

Part of the Kata ecosystem, alongside Kata Orchestrator, Kata Agents, Kata Context.

Core Value

Policy, not storage. Given messages and a context budget, determine the optimal window to send to the model. The value isn't persisting conversations — it's intelligently managing finite context.

The Key Insight

Kata Context answers ONE question: "Given this conversation history and this token budget, what's the optimal context window to send?"

It doesn't care about:

  • Which LLM you're using
  • How your agent is structured
  • What tools you have
  • How you handle responses
┌─────────────────────────────────────┐
│         Your Agent Code             │
│  (LangChain, custom, Kata, etc.)    │
└─────────────────┬───────────────────┘
                  │ "What should I send?"
                  ▼
┌─────────────────────────────────────┐
│         Kata Context                │
│  - Stores full history              │
│  - Applies policy                   │
│  - Returns optimal window           │
└─────────────────┬───────────────────┘
                  │ Optimized context
                  ▼
┌─────────────────────────────────────┐
│         Any LLM                     │
│  (OpenAI, Anthropic, local, etc.)   │
└─────────────────────────────────────┘

Infrastructure, Not Framework

| Aspect | Framework (Letta, LangChain) | Infrastructure (Kata Context) | | ---------------- | ---------------------------- | ----------------------------- | | Relationship | You build inside it | You call it from outside | | Control | Framework controls lifecycle | You control lifecycle | | Opinions | Dictates agent patterns | No opinion on agent design | | Coupling | Tight — hard to leave | Loose — easy to swap | | Analogy | Rails | Postgres |

API

REST API for context management with token-budgeted retrieval:

# Create a context
curl -X POST https://your-app.vercel.app/api/v1/contexts \
  -H "Content-Type: application/json" \
  -d '{"metadata": {"agent": "my-agent"}}'

# Append messages
curl -X POST https://your-app.vercel.app/api/v1/contexts/{id}/messages \
  -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "Hello", "tokenCount": 5}]}'

# Get optimal window for token budget
curl "https://your-app.vercel.app/api/v1/contexts/{id}/window?budget=8000"

SDKs for Python and TypeScript coming in v0.3.0.

Development

# Install dependencies
pnpm install

# Run tests (87 tests, 100% coverage)
pnpm test

# Lint and format
pnpm check

# Database commands
pnpm db:generate   # Generate migrations
pnpm db:migrate    # Apply migrations
pnpm db:studio     # Open Drizzle Studio

# Build
pnpm build

Stack: TypeScript 5.9, pnpm, Biome, Vitest, Drizzle ORM, PostgreSQL (Neon), pgvector, Vercel serverless

Roadmap

  • [x] v0.1.0 — Core Setup (TypeScript, linting, testing, CI)
  • [x] v0.2.0 — Database + Storage Layer (PostgreSQL, repository pattern, REST API)
  • [ ] v0.3.0 — Policy engine (compaction, forking, semantic retrieval)
  • [ ] v1.0 — Hosted API with multi-tenancy

License

Apache 2.0 (core engine and SDKs)