Skip to main content

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.

Metadata

Release files for lysofdev-ailog 1.0.0

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

Source distribution (sdist)

Source distribution for lysofdev-ailog 1.0.0
File Size Uploaded Provenance Actions
lysofdev_ailog-1.0.0.tar.gz 211.1 kB Without provenance Details for lysofdev_ailog-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lysofdev-ailog 1.0.0
File Interpreter ABI Platform Actions
lysofdev_ailog-1.0.0-py3-none-any.whl Python 3 none any Details for lysofdev_ailog-1.0.0-py3-none-any.whl

Total release size: 226.6 kB

Release files / lysofdev_ailog-1.0.0.tar.gz

Download URL lysofdev_ailog-1.0.0.tar.gz
Size 211.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e959719ebbc15f2d3d912a4376369a2c9af9d31b2563791603f648f49c086501
BLAKE2b-256 checksum
How to use checksums
228bf6365eff2207ec1675c574c97dbc183ffc8723f97b0950ec6f7f9b105f7b
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / lysofdev_ailog-1.0.0-py3-none-any.whl

Download URL lysofdev_ailog-1.0.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8725a859defaa8a97b0c5747c4cb2281ddda968986adb845748d2592cf3cdd68
BLAKE2b-256 checksum
How to use checksums
0ee6b94dc0da32f814d4691c89d2b9f1ec5302e4c3f68b1cba5eee066bf4b20f
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for lysofdev-ailog 1.0.0

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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