Skip to main content

Contextual

Local-first temporal semantic code memory engine for AI tools

PyPI License Python

What is Contextual?

Contextual transforms code repositories into queryable, time-aware knowledge structures. Unlike traditional RAG systems that treat code as static documents, Contextual maintains full temporal awareness, structural understanding, and semantic relationships across your entire codebase.

The Four-Way Wedge:

  • Local-first - Embedded storage, no cloud dependency
  • Bitemporal - Tracks when facts were true AND when you learned them
  • Code-aware - AST parsing, not just text chunking
  • Tool-agnostic - MCP integration works with any AI IDE/chat client

Features

  • Hybrid Search - BM25 + vector embeddings with RRF fusion
  • Temporal Queries - Time-travel through your codebase history
  • Knowledge Graph - Entity-relationship triples with CHA/RTA structural resolution and recursive traversal
  • Docs Write - AI-powered documentation updates with two-phase commit
  • Incremental Indexing - Git-aware change detection, BLAKE3 content hashing
  • Multi-Workspace MCP Daemon - One daemon serves a registry of projects; auto-configures Claude Desktop, VS Code Copilot, and Codex

Installation

# Recommended — persistent isolated environment
uv tool install contextual-engine

# Alternative
pipx install contextual-engine

Quick Start

# One-time global setup (downloads the embedding model)
contextual setup

# Initialize a project
cd /path/to/repo
contextual init .

# Index the codebase
contextual index .

# Auto-configure an AI client (writes MCP config for you)
contextual client claude    # or: vscode, codex

Search, temporal queries, and graph traversal are exposed as MCP tools, not CLI subcommands — once a client is wired up, ask it a codebase question directly. See MCP Tools for the full tool list.

MCP Integration

contextual client <name> writes this for you. To configure manually, or for a client it doesn't yet support:

{
  "mcpServers": {
    "contextual": {
      "command": "contextual",
      "args": ["mcp", "start"]
    }
  }
}

The daemon serves every workspace registered via contextual workspace add — no separate server process per project. Manage it directly with contextual mcp start|stop|restart|status|logs.

Documentation

License

Business Source License 1.1 (BUSL-1.1) — see LICENSE for the full terms, including the Additional Use Grant and the Change Date / Change License.

Download files

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

Source Distribution

contextual_engine-1.0.2.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

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

contextual_engine-1.0.2-py3-none-any.whl (934.0 kB view details)

Uploaded Python 3

File details

Details for the file contextual_engine-1.0.2.tar.gz.

File metadata

  • Download URL: contextual_engine-1.0.2.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for contextual_engine-1.0.2.tar.gz
Algorithm Hash digest
SHA256 53c9a122a86ae4d104f74f391810df1af6302a8926d51c27cbc05d9fadbde738
MD5 cfd7ad4cda1f6764737b34812931f0d6
BLAKE2b-256 e4eaf835191fb85b333c9c7b5587094afc02722ba5500430811dc1ca059d498a

See more details on using hashes here.

Provenance

The following attestation bundles were made for contextual_engine-1.0.2.tar.gz:

Publisher: release.yml on aarjunm04/Contextual

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file contextual_engine-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for contextual_engine-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8c201671d0c381ef2ec56811350395544ecc51d81afad56c1f2fbefac2a932b1
MD5 a9fd0c369acb829822b2c85e659d409f
BLAKE2b-256 86e10234b89920ad20d347f52486b9c083ebba275a419f2a1ca10d22085210c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for contextual_engine-1.0.2-py3-none-any.whl:

Publisher: release.yml on aarjunm04/Contextual

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 files

1.0.1

2 files

1.0.0

2 files

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