cogno-homeo
Autonomic resilience kernel for the Cogno cognitive pipeline — circuit breaker, retry/backoff, and a metrics seam behind a signature-agnostic fallback executor.
Named for homeostasis — the body's self-regulation that keeps it stable under stress. Where cogno-anima is the mind and cogno-synapse is the nerve that carries the signal to the models, cogno-homeo is the autonomic layer that keeps those calls alive when providers fail.
Status: alpha — pure-code kernel + unit suite in place.
Pure code: zero dependencies, zero I/O
cogno-homeo orchestrates calls; it never makes one. It knows nothing about LLMs or audio — the result of an attempt is opaque to it. That's exactly why it's shared: both cogno-synapse (text/embeddings) and cogno-vox (STT/TTS) build their fallback chains on the same kernel, instead of each re-implementing the loop.
cogno-synapse ─┐
├─▶ cogno-homeo (breaker + retry + metrics + fallback)
cogno-vox ─────┘
The specialized edge depends on the generic kernel — never the other way around.
The four pieces
| Piece | What it does |
|---|---|
CircuitBreaker |
per-key state machine (closed → open → half-open); stops hammering a dead provider. State behind the StateStore port. |
RetryPolicy |
full-jitter exponential backoff (pure math; the sleep happens in the executor). |
MetricsSink (Protocol) |
reliability telemetry seam — one AttemptRecord per attempt. Host plugs Prometheus/logs; default discards. |
resilient_call(...) |
the signature-agnostic executor that composes the three over an ordered candidate list. |
resilient_call — one executor, any signature
You pass the candidates and a one-line attempt closure; the executor adds breaker + retry + metrics on top. The per-signature bit stays a lambda, so the same kernel serves text and audio:
from cogno_homeo import resilient_call, CircuitBreaker, RetryPolicy
# text (cogno-synapse):
await resilient_call(backends, lambda b: b.generate(system, prompt),
breaker=CircuitBreaker(), policy=RetryPolicy(max_retries=2))
# audio (cogno-vox) — same kernel, different attempt + a "non-empty" success rule:
await resilient_call(transcribers, lambda t: t.transcribe(audio, filename),
is_success=lambda r: bool(r))
First acceptable result wins; if all fail the last exception propagates; if nothing was eligible (empty chain / all breaker-open) it raises NoCandidateAvailable. With no policy/breaker/metrics, it degrades to the historical "try each once, fail over" loop — so wrapping an existing chain changes nothing until you opt in.
Distributed breaker state (host-injected)
The breaker keeps state in-memory per process by default. To share provider health across workers, implement the StateStore port over your store (e.g. Redis) and inject it — the kernel stays pure:
class RedisStateStore: # satisfies StateStore (structural)
def get(self, key): ...
def set(self, key, state): ...
CircuitBreaker(store=RedisStateStore(redis_client))
The breaker key is an opaque string the host composes — e.g. openai:global for a shared key vs openai:byok:{tenant} to isolate a tenant's own credential so one bad key can't trip the breaker for everyone. cogno-homeo never interprets it.
Install
pip install cogno-homeo # zero third-party runtime deps
pip install -e ".[dev]" # tests + lint + type-check
The Cogno ecosystem
cogno-homeo is one organ of Cogno — a family of
small, composable, Apache-2.0 libraries that together form a complete
conversational-agent platform. Each library owns a single concern and stays
infra-agnostic; a host assembles them into a running agent:
The open-source libraries are the organs; the host is the body that joins
them. Our reference host — cogno-host, with its cogno-ui dashboard — is the
private product layer, but it holds no special powers: everything it does rides
on the public seams documented in each library's docs/HOST_INTEGRATION.md, so
you can assemble a body of your own.
Test
pytest tests/unit -q
Metadata
Release files for cogno-homeo 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cogno_homeo-0.1.1.tar.gz | 14.5 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cogno_homeo-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.7 kB
Release files / cogno_homeo-0.1.1.tar.gz
| Download URL | cogno_homeo-0.1.1.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b4f5f39c22f3f34a6c0e298f974dea8112f5635a536d349cd1e2ce6d5c37b81b
|
|
BLAKE2b-256 checksum How to use checksums |
cf171b669273741075ffe48f38378dba05f58311ab16cde2bf412cd45407bcba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 1, 2026.
Transparency logRelease files / cogno_homeo-0.1.1-py3-none-any.whl
| Download URL | cogno_homeo-0.1.1-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ab245bf08956c3fe252ae2fd45e326cb91fe96523f3943582515eb9098bba11
|
|
BLAKE2b-256 checksum How to use checksums |
c4036393eb5d6b18592c7a557d67f72dc139734eae2b1f65a12e44df707ba5ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 1, 2026.
Transparency logSecurity for cogno-homeo 0.1.1
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for cogno_homeo-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 1, 2026.
Transparency logA 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.