Skip to main content

Local-first AI context engine. Access your local data to provide context for any agent.

Project description

AIContext

CI PyPI

The personal context layer for AI agents.

Local-first, private by default, and built to help agents start from your real context — not a blank slate.

aicontext gives agents access to relevant personal context from your own data: coding sessions, browser history, AI conversations, and exported archives. Instead of asking you to repeatedly reconstruct what you were doing, the agent can recover the surrounding thread itself. Recent activity and long-term history combine across sources to surface not just what you did, but who you are: your skills, your curiosities, your habits, and where your attention is going next.

This is not just memory for chatbots. It is a system for ingesting, normalizing, and querying the artifacts of your digital life so agents can better understand what a task is connected to: what you worked on, what you looked at, what you already tried, and what may matter now.

Everything stays under your control. Data is ingested locally, stored locally, and queried locally. No cloud sync, no uploads, no external storage.

Install

pip install sophonme-aicontext && aicontext install

aicontext install scans your machine for supported local data sources, asks for consent before including each source type, ingests approved data into a local SQLite database, and installs the local agent configuration used by supported tools such as Claude Code, Codex, Pi, and OpenClaw.

It does not upload your data or require any cloud service. Changes are limited to local configuration and the ~/.aicontext/ directory, and everything can be removed later with aicontext uninstall.

Scanning for local data sources...

  [found] Claude Code sessions
          /Users/you/.claude/projects
         Include? [Y/n] y
          -> included

  [found] Chrome browser history
          /Users/you/Library/Application Support/Google/Chrome/Default/History
         Include? [Y/n] y
          -> included

Ingesting data...

  Source              Parsed    New  Updated
  ──────────────────────────────────────────
  Claude Code         12,847  12,847        0
  Chrome               8,456   8,456        0
  ──────────────────────────────────────────
  Total               21,303  21,303        0

  Generated SKILL.md  -> ~/.aicontext/skill/SKILL.md
  Claude Code agent   -> ~/.claude/agents/sophonme-context-engine.md
  Codex agent         -> ~/.codex/agents/sophonme-context-engine.toml
  Pi / OpenClaw skill -> ~/.agents/skills/personal-data
  Background sync     -> hourly via launchd (sophonme.aicontext)

Done. The sophonme-context-engine agent is now active in Claude Code, Codex, Pi, and OpenClaw.

Example Prompts

"Do thorough research on my history, and infer my MBTI"
"Recommend a book, video, or podcast for me"
"What do I want to buy the most?"
"Show how deeply you know about me"
"Check my history and suggest what I should do this weekend"
"What is the biggest miss of my daily life that I may not even be aware of?"

How it works

After install, Claude Code and Codex both have a sophonme-context-engine agent. The agent queries your local activity database to surface relevant context for whatever task you're working on.

A background periodic local ingest service (launchd on macOS) re-ingests your data every hour, so context stays fresh without any manual steps.

~/.aicontext/
 ├── data/
 │   ├── activity.db       — unified timeline
 │   └── reference_data/   — full session content
 └── skill/
     ├── SKILL.md
     ├── reference/        — per-source schema docs
     └── scripts/
         └── query.py      — read-only SQL query tool

The agent reads from ~/.aicontext/ using a read-only SQL query script. It never writes to your data, and never sends anything outside your machine.

Supported sources

Source Data
Claude Code Session history, prompts, project paths
Codex Session history, prompts
Chrome Browser visits, downloads
Edge Browser visits, downloads
Dia Browser visits, downloads
Safari Browser visits

More sources coming soon.

Supported agents

Agent Type
Claude Code Subagent
Codex Subagent
Pi Skill
OpenClaw Skill

Troubleshooting

If you use Codex, older app versions may need this in ~/.codex/config.toml for spawned-subagent support:

[features]
multi_agent = true

If your Codex build already supports spawned agents by default, you do not need this. Restart Codex after changing the config.

Privacy

All data is stored locally at ~/.aicontext/. Nothing is sent to any server. The agent only reads from this directory.

However, when an agent queries your data, the results become part of the prompt sent to the model provider (Anthropic, OpenAI, etc.). This means fragments of your personal history may reach the provider's API. Choose a provider you trust, and consider disabling model training on your data to avoid your personal context being used to improve future models:

Contributing

Contributions are welcome, especially new data sources.

The easiest way to contribute is to add a new source under aicontext/sources/. Each source is a single file that implements two methods: ingest_activity() for timeline records and ingest_reference() for full session content. See sources/claude_code.py for the smallest complete example.

Good source ideas include Firefox, Arc, Obsidian, Zotero, Spotify, and shell history.

If you want feedback before building, open an issue with the source you have in mind and any notes on the schema or data shape. That makes it easier to align on fit before you start.

If this project is useful to you, consider giving it a star — it helps more people find it.

GitHub stars

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

sophonme_aicontext-0.1.2.tar.gz (32.1 kB view details)

Uploaded Source

Built Distribution

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

sophonme_aicontext-0.1.2-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

Details for the file sophonme_aicontext-0.1.2.tar.gz.

File metadata

  • Download URL: sophonme_aicontext-0.1.2.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for sophonme_aicontext-0.1.2.tar.gz
Algorithm Hash digest
SHA256 890d1c1ea78c3288ce1fb9fbe7500a1d326c9c5669ce1b5ed3fa7b94c1d32eb0
MD5 c086d89c336363fba595733d2fd36bb8
BLAKE2b-256 aa2506fecc95c5d8f8627d9b52a5a3960e4ad08b5c795d9edcd87b26eccd72c5

See more details on using hashes here.

File details

Details for the file sophonme_aicontext-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for sophonme_aicontext-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d56d74450a8a369941d83526cf58ed1b87e82376aecc492287c421e666ee81ab
MD5 ed335182405510ce3c63f841ca38a47e
BLAKE2b-256 a4d52c905c44edf9f212e56bae7d3668774b29101b8aae2d4050887a9c30fd59

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