Cross-service agent registry for tau_agent — create, store, and retrieve agents, tools, and skills from a database.
Project description
tau_hub
A cross-service persistence and registry layer for tau_agent — the portable harness layer of the tau coding agent.
tau_hub adds a shared database layer so multiple services can create, load, and share agents, tools, and skills — without duplicating configuration or bootstrapping logic across processes.
Why
tau_agent is intentionally stateless and portable — it has no file I/O, no CLI, and no resource-loading. tau_hub fills that gap for multi-service environments: it owns the storage layer and exposes a clean API for agent lifecycle management.
Features
create_agent(...)— define and persist a new agent with its tools and skillsget_agent(name)— load a fully configuredtau_agentharness from the databaseregister_tool(...)— store a tool definition (name, description, schema)get_skill(name)— retrieve a skill prompt/config by name- Backend-agnostic — pluggable
AgentStoreinterface; ships with TinyDB by default - Zero-dependency quick-start — TinyDB backend requires no external services
Installation
# Default install — TinyDB backend (pure Python, zero external dependencies)
pip install tau-hub
# With MongoDB support
pip install tau-hub[mongo]
# With Redis support
pip install tau-hub[redis]
# With PostgreSQL support
pip install tau-hub[postgres]
# Everything
pip install tau-hub[all]
Or from source:
git clone https://github.com/mmpouya/tau_hub
cd tau_hub
pip install -e .
Quick Start
import asyncio
from tau_hub import TauRegistry
from tau_ai.anthropic import AnthropicProvider
from tau_ai.env import AnthropicConfig
from tau_agent.harness import AgentHarness, AgentHarnessConfig
async def main():
# Default: TinyDB backend, stores data in tau_hub.json
registry = TauRegistry()
# get provider or agent
provider = registry.get_provider("gemma-4")
harness_config = AgentHarnessConfig(
provider=provider,
model=provider.model,
system=registry.get_agent("personal_query_agent"),
tools=[registry.get_tool(name=get_weather)]
)
# Initialize the Harness
harness = AgentHarness(harness_config)
# Prompt the agent and react to events
print("User: Hello, who are you?")
async for event in harness.prompt("Hello, who are you?"):
...
# Persist an agent definition
await registry.create_agent(
name="weather_agent",
system="You are a helpful weather assistant.",
tools=["get_weather"],
skills=["metric_units"],
)
asyncio.run(main())
Using a different backend
from tau_hub import TauRegistry
from tau_hub.db.mongo import MongoStore
registry = TauRegistry(store=MongoStore(uri="mongodb://localhost:27017", db="tau"))
Architecture
┌─────────────┐ ┌─────────────┐ ┌───────────────┐
│ Service A │ │ Service B │ │ Service C │
└──────┬──────┘ └──────┬──────┘ └────────┬──────┘
│ │ │
└───────────────────┼─────────────────────┘
│
┌──────▼──────┐
│ tau_hub │ ← this package
└──────┬──────┘
│
┌────────────┼────────────┐
│ │ │
┌──────▼──┐ ┌──────▼──┐ ┌─────▼─────┐
│ TinyDB │ │ MongoDB │ │ Postgres │ ...
│(default)│ │ │ │ / Redis │
└─────────┘ └─────────┘ └───────────┘
tau_hub depends on an abstract AgentStore interface. The public API (create_agent, get_agent, etc.) calls only this interface — never a concrete backend directly. You swap backends by passing a different store= at construction time.
Collections
All entities are stored as flat, independent documents — no relational joins needed:
| Collection | Key | Value |
|---|---|---|
agents |
name |
{system, tools: [...], skills: [...]} |
tools |
name |
{description, schema} |
skills |
name |
{prompt, config} |
Backends
TinyDB (default)
Pure-Python JSON document store. No external service required. Best for single-process or single-writer deployments.
⚠️ TinyDB is not ACID-compliant and does not handle concurrent writes safely across multiple processes. If you run multiple workers writing to the same database simultaneously, use the SQLite or Postgres backend instead.
from tau_hub.db.tinydb import TinyDBStore
store = TinyDBStore(path="tau_hub.json")
MongoDB (requires tau-hub[mongo])
from tau_hub.db.mongo import MongoStore
store = MongoStore(uri="mongodb://localhost:27017", db="tau")
Redis (requires tau-hub[redis])
Stores documents as JSON-serialized hash fields. Suitable when Redis is already in your stack and you want sub-millisecond reads.
from tau_hub.db.redis import RedisStore
store = RedisStore(url="redis://localhost:6379", prefix="tau")
PostgreSQL (requires tau-hub[postgres])
Uses a single documents table with (collection, name, data jsonb). Good for multi-process concurrent writes.
from tau_hub.db.postgres import PostgresStore
store = PostgresStore(dsn="postgresql://user:pass@localhost/tau")
Implementing a Custom Backend
Subclass AgentStore from tau_hub.db.base:
from tau_hub.db.base import AgentStore
class MyStore(AgentStore):
async def get(self, collection: str, name: str) -> dict | None: ...
async def put(self, collection: str, name: str, data: dict) -> None: ...
async def delete(self, collection: str, name: str) -> None: ...
async def batch_get(self, collection: str) -> list[dict]: ...
License
MIT
feature development:
- encryption of api_keys
- seesion handling on db, instead of jsonl
- update endpoint for agents, tools, providers.
- add skills (need
updating code_agent)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tau_hub-0.1.0.tar.gz.
File metadata
- Download URL: tau_hub-0.1.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1db2d8f68fa22ff28eefb2d1e855245159ac91429502670532f7b0ef243ff6ad
|
|
| MD5 |
1399e22ac271c3df83b65faee0a917fa
|
|
| BLAKE2b-256 |
a2f283efc26ddb9e18eda331180c15e81d783c51d5c44635b09eba824743cfbb
|
File details
Details for the file tau_hub-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tau_hub-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5d651924369e86bd5d5ac374ad668130d5a0705a665bd3677cbbb1cd931e970
|
|
| MD5 |
17c42d7714b48471d7c64ad3c4de0745
|
|
| BLAKE2b-256 |
a9da602d150947ca47d651e7c50aa2e1dec53cbfc8e8ce66802409eb2801b61f
|