Skip to main content

vek

Content-addressed execution store for AI agents — git semantics for agent tool calls.

CI

Vek is a minimal execution history layer for AI agents. Every tool call's input and output is stored as an immutable, content-addressed blob, forming a traceable, forkable, branchable execution DAG. Framework-agnostic — plug in with a single function call.

Philosophy

Manage agent execution history like git manages code. Git doesn't care what language you write in. Vek doesn't care what framework your agent runs on.

Install

pip install vek

Quick Start

import vek

vek.init()

# record a single tool call
h = vek.store(tool="search", input={"q": "climate change"}, output={"results": [...]})

# session — auto-chained, atomic recording
with vek.session() as s:
    s.store(tool="search", input=query, output=results)
    s.store(tool="summarise", input=text, output=summary)

# auto-record with decorator
@vek.wrap
def search(query: str) -> dict:
    return {"results": [...]}

# inspect
node = vek.show(h)
blob = vek.cat_file(node["input_hash"])

CLI

vek init                  # create .vek/ repository
vek status                # current branch, tip, stats
vek log [-n 20] [--graph] # execution history / ASCII DAG
vek show <hash>           # inspect a node (short hash OK)
vek cat-file <hash>       # dump raw object content
vek branch [name]         # list or create/switch branches
vek fork <hash>           # fork at a node
vek merge <branch>        # merge branch into current
vek diff <hash1> <hash2>  # structural JSON diff
vek replay <hash>         # replay first-parent chain
vek query [--tool X] [--since T] [--until T] [--branch B] [--limit N]
vek search <pattern> [--field input|output|both] [--limit N]
vek annotate <hash>       # annotate chain with materialised content
vek verify <hash> [--exec-function module:func]  # verify by re-execution
vek diff-chains <h1> <h2> # compare two chains node-by-node
vek reexec <hash> [--exec-function module:func] [--ref name]  # re-execute into new ref
vek checkpoint [label] [hash]  # list or create checkpoints
vek tag [name] [hash]     # list or create tags
vek fsck                  # verify repository integrity
vek gc [--dry-run]        # remove unreachable objects
vek export [--format json|jsonl] [--branch name]
vek import <file> [--format auto|json|jsonl]
vek --version

Python API

Function Description
vek.init() Initialise .vek/ repository
vek.store(tool, input, output) Record one tool call
vek.session() Context manager for atomic batch recording
vek.async_session() Async context manager
vek.wrap(fn) Decorator for auto-recording
vek.hook(dispatch_fn) Wrap a dispatch function
vek.log(n=20) Recent execution history
vek.log_graph() ASCII DAG visualisation
vek.show(hash) Node details with materialised content
vek.cat_file(hash) Raw object bytes
vek.status() Repository summary
vek.branch(name) Create/switch branch
vek.fork(hash, name) Fork at a node
vek.merge(branch) Merge branch (creates multi-parent node)
vek.diff(h1, h2) Structural JSON diff
vek.replay(hash) First-parent chain from root to hash
vek.query(tool=, since=, until=, branch=, limit=) Filtered node query
vek.search(pattern, in_field=, limit=) Search by input/output content
vek.annotate(hash) Annotate chain with materialised content
vek.verify(hash, executor) Dry-run re-execution with output comparison
vek.diff_chains(h1, h2) Compare two chains node-by-node
vek.reexec(hash, executor, ref=) Re-execute chain into new ref
vek.checkpoint(hash, label) Mark verified checkpoint
vek.list_checkpoints() List all checkpoints
vek.tag(name, hash) Lightweight tags
vek.fsck() Integrity verification
vek.gc() Garbage collection
vek.export() Export chains (JSON/JSONL)
vek.import_data(data) Import chains

All hash arguments accept short prefixes (e.g. h[:8]).

Storage Layout

.vek/
├── objects/     # (reserved) content-addressed hash objects
├── refs/        # (reserved) branch pointer files
├── HEAD         # current branch
├── config       # repository configuration
└── vek.db       # SQLite — objects + nodes + refs

Data Model

objects:  hash | content
nodes:    hash | tool | input_hash | output_hash | parent_hash | timestamp | merge_parent
refs:     name | hash                     (branches, tags with "tag/" prefix)

Object Hashing (git-style)

SHA-256( "blob" + " " + size + "\0" + content )   # input/output blobs
SHA-256( "node" + " " + size + "\0" + content )   # execution nodes

Same content stored exactly once. Different types with identical content produce different hashes.

Merge Nodes

Merge creates a node with two parents: parent_hash (current branch) and merge_parent (target branch). Tool is __merge__.

Concurrency

  • SQLite WAL mode with 5s busy timeout
  • store() uses BEGIN IMMEDIATE to serialise concurrent ref updates
  • Advisory file lock (HEAD.lock) prevents concurrent branch pointer writes
  • Sessions batch all writes in a single transaction (atomic commit/rollback)

Design Principles

  • Content-addressed — identical content stored once, forever
  • Immutable — history cannot be tampered with
  • Framework-agnostic — no adapters, no shims
  • Local-first — .vek/ directory, zero external dependencies
  • Minimal API — one function call to integrate
  • Atomic sessions — all-or-nothing batch writes
  • Portable — export/import execution chains as JSON/JSONL

License

AGPL-3.0

Metadata

Release files for vek 0.5.2

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

Source distribution (sdist)

Source distribution for vek 0.5.2
File Size Uploaded Provenance Actions
vek-0.5.2.tar.gz 46.5 kB Without provenance Details for vek-0.5.2.tar.gz

Built distribution (wheel)

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

Total release size: 88.3 kB

Release files / vek-0.5.2.tar.gz

Download URL vek-0.5.2.tar.gz
Size 46.5 kB
Tags Source
SHA-256 checksum
How to use checksums
35aba280d38f5a00e143b216f88113eb1a9d6eb11511dccb101db1c010fa56b2
BLAKE2b-256 checksum
How to use checksums
54646cc449e9444ff02b690a455102b609d7453fc98455a4b0f966ce46acf145
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / vek-0.5.2-py3-none-any.whl

Download URL vek-0.5.2-py3-none-any.whl
Size 41.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7135d9a19f4dda242c17a1c194166e95aa981b7b900e2298841fb5d801b4ea6e
BLAKE2b-256 checksum
How to use checksums
302535d5868fd3b4068ad9476411537cd8c87d9fb0ff283fd2ec67148ad9f849
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Security for vek 0.5.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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