Skip to main content

Contitext

Project continuity for AI agents.

Keep project state, decisions, checkpoints, and handoffs available across agents, sessions, and machines. Contitext is a small, self-hosted Python service backed by PostgreSQL, with REST and eight MCP tools. No LLM API key or embedding service is required.

An agent finishes a session by recording what changed and what comes next. Another agent explicitly selects the same project, reads that context, and continues from the recorded handoff.

Current release: 0.8.0. Install with python -m pip install contitext or pin contitext==0.8.0 for a reproducible setup. This release adds workspace namespaces, managed credentials, safe upgrade checks and independent agent setup. Existing deployments should follow the upgrade guide before changing a live service.

New to Contitext? Follow Getting started for both installation paths, two independently authenticated agents and a visible handoff. For an existing 0.7.1 installation, use its tagged guide.

See release validation, workspaces, upgrade and recovery, and the release plan. Releases use maintainer review, automated checks and documented operational rehearsals. User feedback is welcome through GitHub issues. Contributions follow the PR workflow.

Installation options

Both options run the same Contitext implementation and expose the same eight MCP tools. Neither requires a private repository or a paid service.

Option Requirements Operation
Python package Standard CPython 3.11–3.14 and your PostgreSQL 16+ database Install contitext==0.8.0 from PyPI; run native stdio MCP and optionally REST
Docker Compose Docker with Compose, Git, and Python 3.11–3.14 for bootstrap Build the release source; Compose runs Contitext and PostgreSQL together

Use the installation guide for either path. Python installation does not require Docker. The database is required in both cases; Contitext is not a standalone in-memory or SQLite store. A native MCP client can launch contitext mcp directly without a REST process.

Docker Compose quick start

Requires Docker with Compose, Git, and standard CPython 3.11–3.14.

git clone --branch v0.8.0 --depth 1 https://github.com/jessysw/contitext.git
cd contitext
python3 scripts/bootstrap.py
docker compose up --build -d --wait
curl --fail http://127.0.0.1:18791/health/ready
docker compose exec -T app python -m contitext.demo

The bootstrap script creates fresh local credentials in a private .env, seeds a demo project, and preserves existing configuration. The demo writes synthetic events to that project and demonstrates two agents handing work over through the real HTTP API. Its final output includes:

{
  "agent_b_resumed": "demo",
  "next_action": "Implement and test the first endpoint.",
  "idempotent_retry": "passed"
}

The API listens on localhost. PostgreSQL has no published host port. Data persists in a Compose volume; docker compose down stops the service and preserves it. See installation for Python-package setup, administration, backup, and remote access.

For a real project, use python3 scripts/bootstrap.py --project research --name "Research" and skip the synthetic demo. The self-hosting workflow covers project creation, access management, client setup, and backup recovery. These commands are included in both the PyPI package and the Compose release.

Connect an MCP client

The MCP Registry identifier is io.github.jessysw/contitext. The Registry setup guide explains the PyPI/stdio installation and required database configuration.

After the quick start, add this server to a client that supports stdio MCP. Replace the directory with your own absolute checkout path:

{
  "mcpServers": {
    "contitext": {
      "command": "docker",
      "args": ["compose", "--project-directory", "/absolute/path/to/contitext", "exec", "-T", "app", "contitext", "mcp"]
    }
  }
}

Client configuration formats differ. The same command can be used by any stdio MCP client. Load the agent protocol into the client's instruction mechanism and restart its MCP session. Client settings are changed only when you explicitly run the adapter installer. The MCP server runs locally inside the existing app container and shares its database.

Tool Purpose
project_list List projects accessible to the authenticated caller
project_create Create a project owned by the caller without selecting it
project_bind Explicitly select a project for a caller's conversation scope
project_current Read that scope's current project
context_get Get a bounded project overview, checkpoint, questions, decisions, and handoff
context_record Append a note, decision, question, or checkpoint with provenance
context_handoff Record completed work, current work, blockers, and the next action
context_search Search project events using PostgreSQL full-text search

No project is inferred from the working directory or repository name. Each caller uses a stable conversation scope and explicitly selects a project. Project ACLs are enforced on the server. API contracts and limits describe what the server enforces and what the agent protocol requires.

Commands

Terminal commands use the contitext executable:

contitext --help
contitext --version
contitext init --project research --name "Research"
contitext project list
contitext doctor
contitext migrate
contitext admin seed
contitext serve --host 127.0.0.1 --port 18791
contitext mcp

Use the agent adapter installer to configure your clients with backups and a shared protocol. After installation, use these chat instructions in a conversation with the agent:

!! contitext list
!! contitext create my-project --name "My Project"
!! contitext use my-project
!! contitext status
!! contitext search publishing
!! contitext checkpoint Documented the publishing workflow.

!! contitext is the canonical chat prefix. !! ctx is a shortcut, and !! context remains a legacy alias. These are agent instructions, not terminal subcommands. The terminal CLI currently runs and administers the service; it does not implement chat actions such as use, status, or search, and it does not set a global default project. See the command reference for CLI options, compatibility entry points, and conversation scope behavior.

What it includes

  • Private initialization, project and permission administration, diagnostics, and portable native/Docker/SSH MCP client configuration.
  • Project discovery filtered by caller access, and atomic creation owned by the authenticated caller without an owner UUID or implicit conversation switch.
  • Atomic validation that every event or handoff write matches the caller's conversation binding.
  • A durable, append-only event store with caller identity and source provenance.
  • Reader, writer, and owner project ACLs shared by REST and MCP.
  • Idempotent retries; conflicting reuse of an event key is rejected.
  • PostgreSQL full-text retrieval with pagination, without an embedding dependency.
  • Optional Markdown projection for local inspection and note-taking tools.
  • Synthetic tests for isolation, concurrency, restart recovery, projection, and real MCP stdio calls.

Use Contitext when you need explicit project continuity across tools and machines. It does not automatically capture every conversation, consolidate memories, build a knowledge graph, or decide which facts are true. A project handoff is the latest handoff for the whole project, not a task scheduler or a conflict-resolution system.

Read your context without an agent

Enable the optional Markdown reader to browse project state, decisions, notes, questions, and handoffs in Obsidian or any Markdown reader. No Obsidian plugin, subscription, or account is required for local viewing.

After a fresh Docker setup:

mkdir -p reader-vault
docker compose --profile reader up --build -d --wait

Open reader-vault as an Obsidian vault and start with README.md. The exporter refreshes every 60 seconds and shows the last successful snapshot and refresh status. Native installs use contitext --env-file /absolute/private.env export --output /absolute/reader-vault --watch 60.

This is a generated, one-way reading copy. Edits are not imported. Keep personal notes elsewhere. See the reader guide for existing-install permissions, remote copies, and troubleshooting.

Development

See CONTRIBUTING.md for the isolated PostgreSQL test setup. See SECURITY.md for trust boundaries and vulnerability reporting. Repository: jessysw/contitext.

License

Apache License 2.0.

Metadata

Release files for contitext 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for contitext 0.8.0
File Size Uploaded Provenance Actions
contitext-0.8.0.tar.gz 154.1 kB With provenance Details for contitext-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for contitext 0.8.0
File Interpreter ABI Platform Actions
contitext-0.8.0-py3-none-any.whl Python 3 none any Details for contitext-0.8.0-py3-none-any.whl

Total release size: 217.9 kB

Release files / contitext-0.8.0.tar.gz

Download URL contitext-0.8.0.tar.gz
Size 154.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e28858bc0d164c2360476a64f4f44c160c2d464e4bfaf5c31d2ff64ec1651c21
BLAKE2b-256 checksum
How to use checksums
b10d56b977e827c0d0c88d84f0f0b650750dc52d9a33118f4d2a599193fd73ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / contitext-0.8.0-py3-none-any.whl

Download URL contitext-0.8.0-py3-none-any.whl
Size 63.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71ac7f0990c9049e39fc26083476ecd505ba34c43df8ecc731ed6ffada466e3b
BLAKE2b-256 checksum
How to use checksums
3733319bb79c03338815ac1c204d25b7283b09eec56c25f01bf78a9f630babfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for contitext 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for contitext-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page