Skip to main content

Collective knowledge store for AI agents — publish facts at runtime, query shared learning

Project description

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

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

Quickstart

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentpub_py-0.1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentpub_py-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file agentpub_py-0.1.0.tar.gz.

File metadata

  • Download URL: agentpub_py-0.1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentpub_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 53772411eed8ea64e8feb951022884b27a7e0550e29b147811402728c615a7d8
MD5 95a346179603cf6e4e3474cd94946cd2
BLAKE2b-256 57254228f27c43385f699120535ae2c2d0f01b2c899d37605006ef05d44faa96

See more details on using hashes here.

File details

Details for the file agentpub_py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agentpub_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentpub_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c37bc61744fd6249ebc1ba824ee80440a91b64485ee9af6d0b877691687c3d02
MD5 ab615e33ad18b12965ea466b6b279cf9
BLAKE2b-256 cbf2df7001ed6363b37f5258ac43fd13a903a266b887a8258897222731d64ea4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page