Skip to main content

Portable AI memory from your conversations and data exports.

Project description

context-use

PyPI - Version

Portable AI memory from your conversations and data exports.

demo

For Agents

Make your answers to the human feel truly personal — use the skill at SKILL.md.

For Humans

Install

pip install context-use
# or
uv tool install context-use

Quick start

Start the proxy and point any OpenAI-compatible client at it. Every conversation is automatically turned into memories.

context-use proxy --upstream-url https://api.openai.com

With --upstream-url, the proxy always forwards requests to that upstream URL, so your client only needs to talk to the local proxy:

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8080/v1",
    api_key="<your-openai-key>",
)
client.chat.completions.create(model="gpt-4o", messages=[...])

If you omit --upstream-url, the proxy uses the request Host header instead.

[!NOTE] Only POST /v1/chat/completions requests are enriched with memories. All other paths are forwarded transparently without modification.

Memories are generated in the background from each conversation and are used to automatically enrich future requests that flow through the proxy.

Headless / bring your own API

If you already have your own ASGI server (FastAPI, Starlette, etc.), you can simply mount create_proxy_app:

from context_use import ContextUse, ContextProxy, create_proxy_app
from context_use.proxy import BackgroundMemoryProcessor

ctx = ContextUse(storage=..., store=..., llm_client=...)
await ctx.init()

processor = BackgroundMemoryProcessor(ctx, agent_backend)
handler = ContextProxy(ctx, processor)

asgi_app = create_proxy_app(handler)

Data exports

Bulk-import memories from your data exports. Use this to bootstrap your memory store with historical data.

context-use pipeline --quick <your-zipped-data-export>

[!IMPORTANT] You must have an export from any of the supported providers to use this command.

The quickstart mode uses the real-time API of the LLM provider — fast for small slices but susceptible to rate limits on large exports. Use the Full pipeline to process the complete data export without incurring in rate limits.

Full pipeline

For full data export and cost-efficient batch processing.

context-use pipeline

Ingests the export and generates memories via the batch API of the LLM provider — significantly cheaper and more rate-limit-friendly than the real-time API used by quickstart. Typical runtime: 2–10 minutes. Memories are stored in SQLite and persist across sessions, enabling semantic search and the Personal agent.

Explore your memories

context-use memories list
context-use memories search "hiking trips in 2024"
context-use memories export

Personal agent

A multi-turn agent that operates over your full memory store.

context-use agent synthesise          # generate higher-level pattern memories
context-use agent profile             # compile a first-person profile
context-use agent ask "What topics do I keep coming back to across all my conversations?"

Configuration

context-use config --help

The configuration is saved in a config file at <your-home-directory>/.config/context-use/config.toml.

Getting your export

  1. Follow the export guide for your provider in the supported providers table. The export is delivered as a ZIP file — do not extract it.
  2. Move or copy the ZIP into context-use-data/input/:
context-use-data/
└── input/
    └── your-data-export.zip   ← place it here

Supported providers

Provider Status Data types Export guide
ChatGPT Available Conversations Export your data
Claude Available Conversations Export your data
Instagram Available Stories, Reels, Posts, Likes, Followers, Direct Messages, ... Export your data
Google Coming soon Searches, YouTube Export your data
WhatsApp Coming soon Conversations Export your data

Want another provider? Contribute it by pointing your coding agent to the Adding a Data Provider guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

context_use-0.9.0.tar.gz (117.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

context_use-0.9.0-py3-none-any.whl (213.1 kB view details)

Uploaded Python 3

File details

Details for the file context_use-0.9.0.tar.gz.

File metadata

  • Download URL: context_use-0.9.0.tar.gz
  • Upload date:
  • Size: 117.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for context_use-0.9.0.tar.gz
Algorithm Hash digest
SHA256 5b68c303cc28a96dcbf7d2509d337230127ce7fc9a2dd0446a746fba193996e9
MD5 659500b61febfc793f6cd78386694bec
BLAKE2b-256 c316cf0747dddd9232250cec5047b516fdecdb05b6a22a964efb011fea86eb19

See more details on using hashes here.

File details

Details for the file context_use-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: context_use-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 213.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for context_use-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c85fb775e9dc54ce2f38e0732e5bd57a2a48d20d70ae8c34c097bdecd65a3147
MD5 548f1611db331bc52531839864d6832c
BLAKE2b-256 9d002a3384dbea9c90336b5b12887f883edea679b957adc4869d7cecd753b6ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page