Skip to main content

Temporal-first local code memory for AI tools via MCP

Project description

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 recursive traversal
  • GNN Enhancement - Graph neural networks propagate semantic context
  • Docs Write - AI-powered documentation updates with two-phase commit
  • Incremental Indexing - Git-aware change detection, BLAKE3 content hashing

Installation

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

# Alternative
pipx install contextual-engine

Quick Start

# Initialize project
contextual init /path/to/repo

# Index codebase
contextual index .

# Search
contextual search "authentication middleware"

# Start MCP server (for Claude Desktop, Cursor, etc.)
contextual serve

MCP Integration

Add to your AI tool's MCP config:

{
  "mcpServers": {
    "contextual": {
      "command": "contextual",
      "args": ["serve", "--project", "/path/to/repo"]
    }
  }
}

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.

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

contextual_engine-0.9.2.tar.gz (898.1 kB 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.9.2-py3-none-any.whl (454.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: contextual_engine-0.9.2.tar.gz
  • Upload date:
  • Size: 898.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for contextual_engine-0.9.2.tar.gz
Algorithm Hash digest
SHA256 22f328763f192ede2df37be11c48ed5eac54a1a1ae91c61d722cdfbe4e3d1021
MD5 a272a90613dd5a94fcc3e6f0af49bb12
BLAKE2b-256 7af0cca9d882cb9085614ee7a8fc6b7b73832c470857267e75cbf3677988a805

See more details on using hashes here.

Provenance

The following attestation bundles were made for contextual_engine-0.9.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-0.9.2-py3-none-any.whl.

File metadata

File hashes

Hashes for contextual_engine-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1708fe07f8530499c29e49c03fe9833057069b3f4d7457f6e39599f1fce90141
MD5 5ac0600c5a132b29f7cb3d6fa61c0f32
BLAKE2b-256 720884eb05294fd8eb9226275608e70a237ebc3dbda20f59c1b7298bfd8361a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for contextual_engine-0.9.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.

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