ultracontext

ultracontext

The context API for AI agents

Stars: 131

Visit
 screenshot

UltraContext is a context API for AI agents that simplifies controlling what agents see by allowing users to replace messages, compact or offload context, replay decisions, and roll back mistakes with a single API call. It provides versioned context out of the box with full history and zero complexity. The tool aims to address the issue of context rot in large language models by providing a simple API with automatic versioning, time-travel capabilities, schema-free data storage, framework-agnostic compatibility, and fast performance. UltraContext is designed to streamline the process of managing context for AI agents, enabling users to focus on solving interesting problems rather than spending time gluing context together.

README:

UltraContext

The context API for AI agents.

Documentation · API Reference · Changelog

npm version PyPI version license GitHub stars

Follow on X

UltraContext is the simplest way to control what your agents see.

Replace messages, compact/offload context, replay decisions and roll back mistakes — with a single API call. Versioned context out of the box. Full history. Zero complexity.

Why Context Matters

Context is the RAM of LLMs — everything they can see.

As context grows, model attention spreads thin — this is known as context rot. We should aim to provide the smallest set of high-signal tokens that get the job done.

Right now, we're reinventing the wheel for every car we build. Instead of tackling interesting problems, we catch ourselves spending most of our time gluing context together.

It's time to simplify.

Why UltraContext

  • Simple API — Five methods. That's it.
  • Automatic versioning — Updates/deletes create versions. Nothing is lost.
  • Time-travel — Jump to any point by version, index, or timestamp.
  • Schema-free — Store any JSON. Own your data structure.
  • Framework-agnostic — Works with any LLM framework.
  • Fast — Globally distributed. Low latency.

Star History

Star History Chart


Quick Start

JavaScript/TypeScript

npm install ultracontext
import { UltraContext } from 'ultracontext';

const uc = new UltraContext({ apiKey: 'uc_live_...' });

const ctx = await uc.create();
await uc.append(ctx.id, { role: 'user', content: 'Hello!' });

// use with any LLM framework
const response = await generateText({ model, messages: ctx.data });

Python

pip install ultracontext
from ultracontext import UltraContext

uc = UltraContext(api_key="uc_live_...")

ctx = uc.create()
uc.append(ctx["id"], {"role": "user", "content": "Hello!"})

# use with any LLM framework
response = generate_text(model=model, messages=uc.get(ctx["id"])["data"])

Get an API key from the UltraContext Dashboard.


SDKs

SDK Install Source
JavaScript/TypeScript npm install ultracontext apps/js-sdk
Python pip install ultracontext apps/python-sdk

Documentation


Website · Docs · Issues

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for ultracontext

Similar Open Source Tools

For similar tasks

For similar jobs