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-0.10.0.tar.gz (2.1 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-0.10.0-py3-none-any.whl (879.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: contextual_engine-0.10.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for contextual_engine-0.10.0.tar.gz
Algorithm Hash digest
SHA256 748944c2f46347d751d2c6521f275e15403ef3d7614d251d2f6a73148a9a534c
MD5 72a1951063827c3d2a46cb547210f177
BLAKE2b-256 0c6422ab7dc1bc27c8fde77de9b837b151d52dbe80eda33f25873e9694c14317

See more details on using hashes here.

File details

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

File metadata

  • Download URL: contextual_engine-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 879.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for contextual_engine-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef61de0a534b6855e5480f7ccb0884d4abc8689f2722d5262ef1e1f4491c74f7
MD5 e6e1985ddbfdf8ce54c0f990376e250b
BLAKE2b-256 77024c3d4aaeee93e6460e9f303732ecc1b6b05a83d04f80cb8e5d94298f0f0e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.11.1

2 files

This release

0.10.0 This release

2 files

Supported by

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