import asyncio
from core.bus_client import BusClient
client = BusClient("http://localhost:8765", token="secret")
asyncio.run(client.publish("topic", "hello"))from core.kb import KnowledgeBase
kb = KnowledgeBase("faiss.db")
kb.add_chunk("refactor auth", embedding=[0.1, 0.2])Additional modules are documented inline with docstrings.
Both server/main.py and bus_server.py define FastAPI apps with a lifespan
context to manage startup/shutdown (DB pool, Redis). You can mount them into a
parent app, and resources will be acquired/released correctly:
from fastapi import FastAPI
from server.main import app as backend_app
from bus_server import app as bus_app
app = FastAPI()
app.mount("/api", backend_app)
app.mount("/bus", bus_app)Run with uvicorn module:app or integrate into your ASGI stack.