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

pip 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

Apache 2.0

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.2.0.tar.gz (6.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.2.0-py3-none-any.whl (172.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: contextual_engine-0.2.0.tar.gz
  • Upload date:
  • Size: 6.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for contextual_engine-0.2.0.tar.gz
Algorithm Hash digest
SHA256 376ab45dabb921b65870b4984fc11c79c3ab0f11860147c988432c7b930f7d7d
MD5 a2ee27465f7f4b7fb2736f563b581fef
BLAKE2b-256 298772740c1e6aa682dd80e8d464b9f3e1d6235dcc5ab045910d07698d67867a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for contextual_engine-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c582fdde78d881516c985bce539611d5382e32b918ad6bf0113f1c641bf25de7
MD5 3cb4941714b74920ae39bf72537a91b5
BLAKE2b-256 334dd63e362b08f31660b7b1a50dd86264a2a08e0344f5f3c676c8fa31b6908f

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