Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

teenyfactories

Agent runtime for TeenyFactories. Postgres-backed pub/sub, multi-provider LLM calls, vector search.

pip install --pre teenyfactories
import teenyfactories as tf

@tf.on_state('documents', 'loaded').do
def analyse(item):
    tf.collection('documents').set(item['key'], state='analysed')

while True:
    tf.run_pending()
    tf.sleep(1)

Writing a row with a given state fires NOTIFY {factory}.{collection}.{state}. Every subscriber to that pair gets the row. That's the framework.

Public API

Group Names
Pub/sub on_state, on_message, send_message, run_pending
Data collection (.set, .add, .get, .get_all, .remove, .count, .exists, .vector_search)
LLM call_llm, embed
MCP add_mcp_server, add_mcp_tool
Schedule on_schedule.every(N).<unit>.do(handler)
Logging log_debug, log_info, log_warn, log_error, log_persona
Time / IDs get_timestamp, get_timestamp_utc, generate_unique_id
Util sleep, PROJECT_NAME, FACTORY_PREFIX, __version__

Anything not in this list is not part of the supported surface — don't reach into submodules.

How it plugs in

A factory is a directory:

my_factory/
├── factory.yml
└── agents/
    ├── poller.py
    └── enricher.py

Each agents/*.py runs in its own container based on ghcr.io/teenyfactories/agent:dev — which has this library pre-installed. Single-factory mode runs each file as a docker compose service; multi-factory mode runs them under the orchestrator. Either way, agent code is just import teenyfactories as tf + handlers + main loop.

Full setup, compose templates, environment variable reference: see the core repo.

Versioning

PEP 440 dev pre-releases: 0.1.0.devYYYYMMDD. pip install teenyfactories will NOT pick these up — you need --pre (latest dated build) or an explicit pin (teenyfactories==0.1.0.dev20260512).

License

MIT.

Metadata

Release files for teenyfactories 0.1.0.dev20260616

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

Source distribution (sdist)

Source distribution for teenyfactories 0.1.0.dev20260616
File Size Uploaded Provenance Actions
teenyfactories-0.1.0.dev20260616.tar.gz 77.6 kB Without provenance Details for teenyfactories-0.1.0.dev20260616.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for teenyfactories 0.1.0.dev20260616
File Interpreter ABI Platform Actions
teenyfactories-0.1.0.dev20260616-py3-none-any.whl Python 3 none any Details for teenyfactories-0.1.0.dev20260616-py3-none-any.whl

Total release size: 162.8 kB

Release files / teenyfactories-0.1.0.dev20260616.tar.gz

Download URL teenyfactories-0.1.0.dev20260616.tar.gz
Size 77.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a886a6656f6fa0ba467850e509bf4fd4a3bb865c2c3c8e0d76e61aa489028ac2
BLAKE2b-256 checksum
How to use checksums
94016a38f2f167278091b05a232506ac0e2559838c6a96f83509f04911ed6401
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / teenyfactories-0.1.0.dev20260616-py3-none-any.whl

Download URL teenyfactories-0.1.0.dev20260616-py3-none-any.whl
Size 85.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
220c3305625c4686dd2d0c5f2a64c41ed5cc1c5c177e24e37c69fea92ef76360
BLAKE2b-256 checksum
How to use checksums
115154a6f193c0832d2e4756f5b99fa3fbc5753889c0fbfb58a4110efcec4e3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for teenyfactories 0.1.0.dev20260616

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.

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