an atomdrift project
Hostile 99% python Download

hindsight-api-slim 0.10.0

Legitimate memory API package

Applies wraps to nested Python functionAstrBot untrusted chunk marker

Evidence

References the phrase "AI agent" __init__.py · lines 1–14
1"""
2Memory System for AI Agents.
3
4Temporal + Semantic Memory Architecture using PostgreSQL with pgvector.
5
6**Importing this package is cheap.** The public names below resolve on first ACCESS, via the
7module ``__getattr__`` of PEP 562, rather than being pulled in at import time. That is a load-time
8property other things depend on, not a preference:
9
10``hindsight-api --workers N`` was killing and respawning its workers forever. uvicorn's
11multiprocess supervisor uses **spawn**, so every child rebuilds ``__main__`` by re-running
12``sys.argv[0]`` — pip's console-script wrapper — whose top line is
13``from hindsight_api.main import main``. That import reached this module, and this module used to
14pul …
Calls a function at Python module scope __init__.py · lines 38–46
38:11… t_api/_thread_limits.py for the rationale.
39from ._thread_limits import apply_default_thread_limits
40
41apply_default_thread_limits()
42
43__version__ = "0.10.0"
44
45# name -> (module, attribute). Kept as data so `__all__`, `__dir__` and the resolver cannot drift.
46_LA …
imports import_module from importlib __init__.py · lines 76–81
76:36… le {__name__!r} has no attribute {name!r}") from None
77
78 from importlib import import_module
79
80 value = getattr(import_module(module_name, __name__), attribute)
81 # Bind it so every later access is a plain global lookup rather than anoth …
Python asyncio library reference _cross_loop.py · lines 1–5
1"""Concurrency primitives that several event loops in one process can share.
2
3``asyncio.Lock``/``Semaphore`` bind to the event loop that first *waits* on them.
4That is fine for state one loop owns, and wrong for anything process-wide: the first
5contended acquire claims the primitive for its loop, …
LLM or language-model token text _cross_loop.py · lines 24–29
24:52… `` between the handoff and the
25waiter resuming. These caps gate LLM calls and llama.cpp server startup — operations
26measured in hundreds of milliseconds to minutes — so that is not measurable. Do not
27reach for this to guard something short and hot; scope the state per loop instead.
28
29**The cost of handing over …

Showing the top 5 files — 7 more files (122 regions) not shown.

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.