Catalog PyPI
PACKAGE EXPLORERView in registry

agentlog-sdk

PyPI

Python SDK for agentlog - a local-first decision log daemon for agentic workflows

agentagenticdecision-logllmlogging
Versions collected1
Direct dependencies0From release 0.2.0
Last observed20 Oct, 22:37 UTC

README

Version 0.2.0 documentation

agentlog Python SDK

Python client for agentlog - a local-first decision log daemon for agentic workflows.

Installation

pip install agentlog-sdk

Quickstart

import agentlog

agentlog.write("decision", "Use PostgreSQL for persistence")
entries = agentlog.query("database")

Requirements

  • Python 3.9+
  • A running agentlogd daemon (see the main project README)

Usage

Writing entries

import agentlog

# Write a decision entry (session created automatically)
agentlog.write(
    "decision",
    "Use Redis for caching",
    body="Redis provides sub-millisecond reads and built-in TTL support.",
    tags=["infrastructure", "caching"],
    files=["config/redis.yaml"],
)

# Supported entry types: decision, attempt_failed, deferred, assumption, question
agentlog.write("assumption", "All users have Python 3.9+")
agentlog.write("question", "Should we use async or sync HTTP client?")

Searching entries

# Full-text search
results = agentlog.query("database migration")

# Search with filters
results = agentlog.query("caching", type="decision", limit=5)

Listing entries

# List entries by type
entries = agentlog.log(type="decision")

# List entries by session
entries = agentlog.log(session="your-session-id")

# List entries by tag
entries = agentlog.log(tag="infrastructure")

# List entries from the last hour
entries = agentlog.log(since="1h")

Getting context for prompts

# Get context by topic
context = agentlog.context(topic="authentication")

# Get context by file paths
context = agentlog.context(files=["internal/auth/jwt.go"])

# Combine both
context = agentlog.context(files=["internal/auth/jwt.go"], topic="authentication")

# Limit results
context = agentlog.context(topic="caching", limit=5)

print(context)
# Output:
# # Recent decisions
#
# ## [decision] Use JWT for API auth (2026-03-15 10:30)
# JWTs are stateless and work well with our microservices architecture.
# Tags: auth, api
# Files: internal/auth/jwt.go

Using the client class directly

from agentlog import AgentlogClient

# Custom socket path
client = AgentlogClient(agentlog_dir="/custom/path")

# Or explicit socket path
client = AgentlogClient(socket_path="/tmp/agentlogd.sock")

# All methods are available on the client instance
entry_id = client.write("decision", "Use gRPC for internal services")

Configuration

The SDK looks for the daemon socket at ~/.agentlog/agentlogd.sock by default. Override this with:

  • The AGENTLOG_DIR environment variable
  • The agentlog_dir constructor argument
  • The socket_path constructor argument (takes precedence)

Error handling

from agentlog import AgentlogError, ConnectionError, DaemonNotRunning

try:
    agentlog.write("decision", "Test entry")
except DaemonNotRunning:
    print("Start the daemon first: agentlog start")
except ConnectionError as e:
    print(f"Connection failed: {e}")
except AgentlogError as e:
    print(f"Unexpected error: {e}")

Development

# Install in development mode
pip install -e sdk/python/

# Run tests
python -m pytest sdk/python/tests/ -v

# Run only unit tests (no daemon required)
python -m pytest sdk/python/tests/test_client.py -v

Downloads & popularity

2downloads
1-day window · source-reported counts20 Oct 2026
94.50
2026-07-23: 3 · observed 2026-10-21T13:01:18.8935982Z · period 2026-07-23–2026-07-232026-07-26: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-07-26–2026-07-262026-07-27: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-07-27–2026-07-272026-08-02: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-02–2026-08-022026-08-03: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-03–2026-08-032026-08-04: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-04–2026-08-042026-08-07: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-07–2026-08-072026-08-09: 3 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-09–2026-08-092026-08-10: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-10–2026-08-102026-08-12: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-12–2026-08-122026-08-13: 5 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-13–2026-08-132026-08-14: 4 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-14–2026-08-142026-08-15: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-15–2026-08-152026-08-17: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-17–2026-08-172026-08-18: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-18–2026-08-182026-08-23: 3 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-23–2026-08-232026-08-24: 5 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-24–2026-08-242026-08-25: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-25–2026-08-252026-08-28: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-28–2026-08-282026-08-31: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-08-31–2026-08-312026-09-07: 7 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-07–2026-09-072026-09-10: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-10–2026-09-102026-09-14: 6 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-14–2026-09-142026-09-15: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-15–2026-09-152026-09-16: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-16–2026-09-162026-09-17: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-17–2026-09-172026-09-20: 8 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-20–2026-09-202026-09-21: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-21–2026-09-212026-09-22: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-22–2026-09-222026-09-23: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-23–2026-09-232026-09-26: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-26–2026-09-262026-09-27: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-27–2026-09-272026-09-28: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-28–2026-09-282026-09-29: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-29–2026-09-292026-09-30: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-09-30–2026-09-302026-10-02: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-10-02–2026-10-022026-10-06: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-10-06–2026-10-062026-10-08: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-10-08–2026-10-082026-10-09: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-10-09–2026-10-092026-10-10: 4 · observed 2026-10-21T13:01:18.8935982Z · period 2026-10-10–2026-10-102026-10-12: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-10-12–2026-10-122026-10-13: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-10-13–2026-10-132026-10-14: 1 · observed 2026-10-21T13:01:18.8935982Z · period 2026-10-14–2026-10-142026-10-15: 6 · observed 2026-10-21T13:01:18.8935982Z · period 2026-10-15–2026-10-152026-10-16: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-10-16–2026-10-162026-10-17: 9 · observed 2026-10-21T13:01:18.8935982Z · period 2026-10-17–2026-10-172026-10-18: 4 · observed 2026-10-21T13:01:18.8935982Z · period 2026-10-18–2026-10-182026-10-20: 2 · observed 2026-10-21T13:01:18.8935982Z · period 2026-10-20–2026-10-20
23 Jul20 Oct

pypistats · 48 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-20 – 2026-10-2022026-10-21T13:01:18.8935982Z
2026-10-18 – 2026-10-1842026-10-21T13:01:18.8935982Z
2026-10-17 – 2026-10-1792026-10-21T13:01:18.8935982Z
2026-10-16 – 2026-10-1622026-10-21T13:01:18.8935982Z
2026-10-15 – 2026-10-1562026-10-21T13:01:18.8935982Z
2026-10-14 – 2026-10-1412026-10-21T13:01:18.8935982Z
2026-10-13 – 2026-10-1312026-10-21T13:01:18.8935982Z
2026-10-12 – 2026-10-1212026-10-21T13:01:18.8935982Z
2026-10-10 – 2026-10-1042026-10-21T13:01:18.8935982Z
2026-10-09 – 2026-10-0922026-10-21T13:01:18.8935982Z
2026-10-08 – 2026-10-0812026-10-21T13:01:18.8935982Z
2026-10-06 – 2026-10-0612026-10-21T13:01:18.8935982Z
2026-10-02 – 2026-10-0212026-10-21T13:01:18.8935982Z
2026-09-30 – 2026-09-3012026-10-21T13:01:18.8935982Z
2026-09-29 – 2026-09-2912026-10-21T13:01:18.8935982Z
2026-09-28 – 2026-09-2822026-10-21T13:01:18.8935982Z
2026-09-27 – 2026-09-2712026-10-21T13:01:18.8935982Z
2026-09-26 – 2026-09-2612026-10-21T13:01:18.8935982Z
2026-09-23 – 2026-09-2322026-10-21T13:01:18.8935982Z
2026-09-22 – 2026-09-2212026-10-21T13:01:18.8935982Z
2026-09-21 – 2026-09-2112026-10-21T13:01:18.8935982Z
2026-09-20 – 2026-09-2082026-10-21T13:01:18.8935982Z
2026-09-17 – 2026-09-1722026-10-21T13:01:18.8935982Z
2026-09-16 – 2026-09-1622026-10-21T13:01:18.8935982Z
2026-09-15 – 2026-09-1512026-10-21T13:01:18.8935982Z
2026-09-14 – 2026-09-1462026-10-21T13:01:18.8935982Z
2026-09-10 – 2026-09-1022026-10-21T13:01:18.8935982Z
2026-09-07 – 2026-09-0772026-10-21T13:01:18.8935982Z
2026-08-31 – 2026-08-3122026-10-21T13:01:18.8935982Z
2026-08-28 – 2026-08-2812026-10-21T13:01:18.8935982Z
2026-08-25 – 2026-08-2512026-10-21T13:01:18.8935982Z
2026-08-24 – 2026-08-2452026-10-21T13:01:18.8935982Z
2026-08-23 – 2026-08-2332026-10-21T13:01:18.8935982Z
2026-08-18 – 2026-08-1822026-10-21T13:01:18.8935982Z
2026-08-17 – 2026-08-1722026-10-21T13:01:18.8935982Z
2026-08-15 – 2026-08-1522026-10-21T13:01:18.8935982Z
2026-08-14 – 2026-08-1442026-10-21T13:01:18.8935982Z
2026-08-13 – 2026-08-1352026-10-21T13:01:18.8935982Z
2026-08-12 – 2026-08-1212026-10-21T13:01:18.8935982Z
2026-08-10 – 2026-08-1022026-10-21T13:01:18.8935982Z
2026-08-09 – 2026-08-0932026-10-21T13:01:18.8935982Z
2026-08-07 – 2026-08-0712026-10-21T13:01:18.8935982Z
2026-08-04 – 2026-08-0422026-10-21T13:01:18.8935982Z
2026-08-03 – 2026-08-0322026-10-21T13:01:18.8935982Z
2026-08-02 – 2026-08-0212026-10-21T13:01:18.8935982Z
2026-07-27 – 2026-07-2722026-10-21T13:01:18.8935982Z
2026-07-26 – 2026-07-2612026-10-21T13:01:18.8935982Z
2026-07-23 – 2026-07-2332026-10-21T13:01:18.8935982Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.017 Mar 20260

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
byronxlg/agentlog

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:37 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:29a5166a9eaf2bd65cc0c6d94657d657dd55a48e0ceb06b45bb8142f356d02c7