Metadata-Version: 2.4
Name: agentpub-py
Version: 0.1.0
Summary: Collective knowledge store for AI agents — publish facts at runtime, query shared learning
Project-URL: Homepage, https://github.com/naveenkumarbaskaran/agentpub
Project-URL: Repository, https://github.com/naveenkumarbaskaran/agentpub
Project-URL: Issues, https://github.com/naveenkumarbaskaran/agentpub/issues
Author: Naveen Kumar Baskaran
License: Apache-2.0
Keywords: agents,enterprise,knowledge,learning,llm,memory,pub
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.11
Provides-Extra: all
Requires-Dist: agentmesh-bus>=0.1.0; extra == 'all'
Requires-Dist: aiosqlite>=0.20; extra == 'all'
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Provides-Extra: mesh
Requires-Dist: agentmesh-bus>=0.1.0; extra == 'mesh'
Provides-Extra: sqlite
Requires-Dist: aiosqlite>=0.20; extra == 'sqlite'
Description-Content-Type: text/markdown

# agentpub-py

Collective knowledge store for AI agents. Agents publish facts they discover at runtime. Other agents subscribe or query. Knowledge is built by the agents themselves — not pre-loaded.

## Install

```bash
pip install agentpub-py                 # in-memory (session-scoped)
pip install "agentpub-py[sqlite]"       # persistent (survives restarts)
```

## Quickstart

```python
import asyncio
from agentpub import AgentPub, Fact

async def main():
    pub = AgentPub()

    # Agent A discovers customer tier
    await pub.publish(Fact(
        key="acme.customer.C123.tier",
        value="premium",
        publisher_id="crm-agent",
        tenant_id="acme",
        ttl_s=3600,
        confidence=0.95,
    ))

    # Agent B queries the knowledge
    fact = await pub.get("acme.customer.C123.tier")
    print(f"{fact.key} = {fact.value} (confidence={fact.confidence})")

    # Agent C subscribes to updates
    @pub.subscribe("acme.customer.*")
    async def on_update(fact: Fact) -> None:
        print(f"Knowledge updated: {fact.key} = {fact.value}")

asyncio.run(main())
```

## Persistent Store

```python
from agentpub import AgentPub
from agentpub.store.jsonl import JsonlStore

# Persists to disk — survives restarts
pub = AgentPub(persistent_store=JsonlStore("~/.agentpub/facts.jsonl"))
```

## Stack

```
agentpub     → knowledge     shared learning across agents
agentmesh    → events        publishes fact updates to subscribers
agentgrid    → routing       routes tasks using published knowledge
agentregistry → discovery    agent capabilities
```

---

Apache 2.0 · [PyPI](https://pypi.org/project/agentpub-py/)
