Skip to main content

Versioned Intent and Context History for Agentic Reasoning — capture the why behind AI agent decisions

Project description

VICHAR — विचार

Versioned Intent and Context History for Agentic Reasoning

VICHAR captures why AI agents make decisions — not just what they do. Every decision, open question, and task is recorded so the next session (or a different agent) starts with full context instead of zero.


Install

pip install vichar

Or from source:

git clone https://github.com/shivranjankolvankar/vichar
cd vichar
pip install -e .

Quick start

# Initialise in your project
cd my-project
vichar init

# Agents capture reasoning as they work
vichar capture "Use FastAPI over Flask" \
  --type decision \
  --author claude-code \
  --body "Flask lacks async support. FastAPI gives us OpenAPI docs for free."

# At session start — read prior context
vichar log

# Confirm an entry (human ratification)
vichar ratify abc12345

# One-line project summary
vichar status

Core concept: the trust gradient

Status Meaning
proposed Agent-written, unreviewed
ratified Human-confirmed
closed No longer relevant

Agents write freely. Humans decide what to trust.


Commands

Command Description
vichar init Stamp project, write agent files, inject into CLAUDE.md + .cursor/rules
vichar capture "<text>" Capture a decision, thread, or task
vichar ratify <id> Mark an entry as human-confirmed
vichar close <id> Close an entry
vichar log Show open entries (rich table)
vichar status One-line project summary (add --json for machine output)
vichar migrate Upgrade pre-schema entries to schema v1
vichar uninit Remove VICHAR injection from CLAUDE.md + .cursor/rules
vichar-server Start HTTP server on port 7474 (fallback for shell-less agents)

HTTP server (agent fallback)

When an agent cannot run shell commands, it can POST over HTTP instead:

vichar-server [--port 7474] [--host 127.0.0.1]
import urllib.request, json

def vichar(title, type="decision", body="", author="agent"):
    data = json.dumps({"title": title, "type": type,
                       "body": body, "author": author}).encode()
    req = urllib.request.Request(
        "http://localhost:7474/capture", data=data,
        headers={"Content-Type": "application/json"}, method="POST")
    try:
        with urllib.request.urlopen(req, timeout=2) as r:
            return json.loads(r.read())
    except Exception:
        return None  # never block on VICHAR

Server endpoints: GET / GET /status GET /log POST /capture POST /ratify POST /close


Agent integration

vichar init writes instruction files and injects them automatically:

  • Claude Code (CLAUDE.md): injects @.vichar/CLAUDE.md import line
  • Cursor (.cursor/rules): inlines the full instruction block
  • Both injections are non-destructive (VICHAR START/END markers, idempotent)

The agent files tell Claude / Cursor when to capture, how to capture, and the HTTP fallback snippet.


What gets stored

Each entry in .vichar/entries.json has:

Field Description
id 8-char hex identifier
type decision / thread / task
status proposed / ratified / closed
title One-line summary
body Extended reasoning (markdown)
author claude-code / cursor / human / agent
schema "1" (schema version)

Zero dependencies

VICHAR is pure Python stdlib — no rich, no colorama, no click. It works in any Python 3.8+ environment without pip install overhead.


License

MIT

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

vichar-0.1.1.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

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

vichar-0.1.1-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file vichar-0.1.1.tar.gz.

File metadata

  • Download URL: vichar-0.1.1.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.2

File hashes

Hashes for vichar-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0beaa852e3aa6335a7bb12c45ac6d14ad468aa5cb85d50f73a202d5869589103
MD5 6dab27b98691eda9126fa20d8dcbe295
BLAKE2b-256 59179a8487a609ff67d4d6931b5a5ef7a99de5d16fc1021ae1258645fbb0d3d8

See more details on using hashes here.

File details

Details for the file vichar-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: vichar-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.2

File hashes

Hashes for vichar-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a2948919430553b17c92f4c974fcb552a4204c18ab8a9b5b2223a7ddd2e9a5a
MD5 90f0550e323dcdfad53c7de247265633
BLAKE2b-256 5bb75f9e71326c4dcb218e8d7c22c2496a132149ace1d347067423bfb95e8e80

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