Skip to main content

File-based AI work log with semantic search — a git log for why AI agents made changes

Project description

ailog

A file-based AI work log with semantic search. Think git log, but for why AI agents made changes — searchable by meaning, not just keywords.

AI tools append entries describing their reasoning. You (or another agent) can later search those entries semantically to understand the codebase.

$ ailog search "why did we change the auth flow"

Top 3 results for: why did we change the auth flow

2026-05-18 14:22  claude  abc12345 [auth] [refactor]  score=0.941
Extracted JWT validation into shared middleware because three routes were
duplicating the same token-expiry logic. Silent 401s are now propagated correctly.

2026-05-17 09:11  claude  def67890 [auth]  score=0.812
Switched from session cookies to JWTs to support the mobile client, which
can't use httpOnly cookies cross-origin.

Installation

# pip
pip install ailog

# uv (recommended)
uv tool install ailog

Requires Python 3.11+.

Setup

Get a free API key from Voyage AI (200M tokens/month free tier), then:

export VOYAGE_API_KEY="your-key-here"

Add this to your shell profile (~/.zshrc, ~/.bashrc) to make it permanent.

Getting started

Initialize ailog inside a git repository:

ailog init

This creates an empty .ailog log, an ailog.toml config, and adds the regenerable embedding cache (.ailog.cache/) to .gitignore. Commit .ailog and ailog.toml; the cache stays local.

Usage

Every command below accepts --json for machine-readable output (no colors, no decoration) — useful when another AI tool consumes the log.

Adding entries

AI agents call ailog add after completing a task:

ailog add "Refactored the pricing engine because three services were computing
discounts independently with different rounding logic. Consolidated into
PricingService.calculate() with a shared RoundingMode enum."

# With tags and agent name
ailog add "Fixed race condition in order processor" \
  --agent claude \
  --tag bugfix \
  --tag async

Searching

# Semantic proximity search
ailog search "why did we change the payment flow"

# Return more results
ailog search "database connection handling" --top 10

# Filter by tag before searching
ailog search "auth changes" --tag security

Browsing the log

# Full chronological log (most recent first)
ailog log

# Compact one-liner per entry
ailog log --oneline

# Filter by tag or agent
ailog log --tag refactor
ailog log --agent claude --limit 20

Stats

ailog stats
ailog stats
  File:     /your/repo/.ailog
  Entries:  47  (47 with embeddings)
  Span:     2026-04-01 → 2026-05-18

  Agents:
    claude: 38
    human: 9

  Tags:
    refactor: 14
    bugfix: 11
    auth: 6

Committing the log

The .ailog file and ailog.toml are meant to be committed — that's the point. If your entries contain sensitive information, add .ailog to .gitignore instead.

In inline mode the embedding vectors live in .ailog and are large float arrays; you can hide them from diffs with a .gitattributes diff driver that strips the embedding field. In cache mode (the default) this is unnecessary — .ailog holds only text.

Git hook

Link commits to the log entry that motivated them:

ailog install-hook

This installs a post-commit hook that appends an Ailog-Entry: <id> trailer to each commit message, so you can trace from git log directly to the reasoning behind a change. Re-running ailog install-hook is safe — it detects an existing ailog hook and does nothing.

How it works

  • The .ailog text log is the source of truth: append-only JSONL at the repo root
  • Search embeds the query with the same model and ranks entries by cosine similarity
  • No external database — everything lives in plain files you can commit

Storage modes

ailog.toml selects how embeddings are stored:

Mode .ailog contains Embeddings live in Trade-off
cache (default) text entries only gitignored .ailog.cache/ (SQLite) clean diffs, small git history; re-embeds once on a fresh clone
inline text + embedding vectors the committed .ailog itself works fully offline; git history grows with every entry

In cache mode the embedding cache is a derived artifact — never committed. After cloning the repo onto a new machine, run:

ailog reindex

to rebuild it (search also rebuilds lazily on first use). Switching the model in ailog.toml and running ailog reindex re-embeds everything.

Entry format

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "ts": "2026-05-18T14:22:00+00:00",
  "agent": "claude",
  "tags": ["auth", "refactor"],
  "msg": "Extracted JWT validation into middleware..."
}

In inline mode the entry also carries an "embedding" field.

Embedding model

Uses Voyage AI's voyage-code-3 model, which is purpose-built for code and mixed code/text retrieval. Anthropic recommends Voyage AI for RAG use cases (they acquired the company).

Rate limits on the free tier

Voyage AI's free tier allows 200M tokens/month but caps requests at 3 RPM until you add a payment method to your account. This limit applies across all API calls — ailog add and ailog search each consume one request, so running several commands back-to-back will trigger a RateLimitError.

To lift the cap: add a payment method at dashboard.voyageai.com (the free token allowance still applies). After a few minutes, your rate limit increases to the standard tier.

If you hit the limit, ailog will print a clear error message and exit — no data is lost, and re-running the command once the window resets works fine.

License

MIT — see LICENSE.

Development

Running tests

Install dev dependencies:

uv sync --extra dev

Then run the test suite:

uv run pytest

Run with coverage:

uv run pytest --cov

Linting and type checking

uv run ruff check .
uv run mypy src

CI runs the test suite (Python 3.11 and 3.12) plus ruff and mypy on every push and pull request.

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

lysofdev_ailog-1.0.0.tar.gz (211.1 kB view details)

Uploaded Source

Built Distribution

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

lysofdev_ailog-1.0.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file lysofdev_ailog-1.0.0.tar.gz.

File metadata

  • Download URL: lysofdev_ailog-1.0.0.tar.gz
  • Upload date:
  • Size: 211.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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 lysofdev_ailog-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e959719ebbc15f2d3d912a4376369a2c9af9d31b2563791603f648f49c086501
MD5 86961090a21c1515b0eacc4c3cf391cb
BLAKE2b-256 228bf6365eff2207ec1675c574c97dbc183ffc8723f97b0950ec6f7f9b105f7b

See more details on using hashes here.

File details

Details for the file lysofdev_ailog-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: lysofdev_ailog-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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 lysofdev_ailog-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8725a859defaa8a97b0c5747c4cb2281ddda968986adb845748d2592cf3cdd68
MD5 22c41d3a835f87f18da575da804c5569
BLAKE2b-256 0ee6b94dc0da32f814d4691c89d2b9f1ec5302e4c3f68b1cba5eee066bf4b20f

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