An orchestrated multi-agent framework coordinating specialized Researcher, Writer, and Editor agents in a collaborative state graph to produce publication-ready newsletters.
The interesting part is not that it calls a model. It is that it does not trust one.
CollabX scores every draft it produces: real Flesch Reading Ease against a per-tone floor, every statistic and quotation traced back to a source dossier, and a bounded Editor β Writer revision loop that sends failing drafts back with the specific critique that failed them. Those gates run identically whether the prose came from a language model or from the built-in template engine.
Important
It runs with no API key, no model, and no network. That is the default.
git clone, pip install -e ., uvicorn β and it works. A model is an
opt-in upgrade (free options below), never a
requirement, because a project you cannot run is a screenshot.
curl -X POST localhost:8014/api/v1/editorial/produce-newsletter \
-H 'Content-Type: application/json' -d '{"topic":"Agent Workforces"}'The Researcher assembles a dossier, the Writer drafts from it, and the Editor scores the result and sends it back for revision if it fails a gate:
Readability (Flesch Reading Ease) is 53.7 against a 55 floor for
'Engaging Storyteller'. Short by 1.3 points.
Fact-check: 3 of 3 checkable claims trace to the research dossier.
Tone alignment with 'Engaging Storyteller' is 0.92 against a 0.75 floor.
Sources: built-in sample fixture, identical for every topic. Not real research.
Editorial loop: 1 revision round applied, all gates passing at publication.
Every number there is measured from the draft. None of them is a constant.
- Specialized Multi-Agent Roles β three separable stages with distinct
responsibilities and a typed hand-off between each:
ResearcherAgent: produces aResearchDossierof findings and core themes.WriterAgent: produces anArticleDraftβ headline, hook, and structured sections.EditorAgent: produces aPublishedNewsletterwith feedback and compiled HTML.
- Typed Editorial Domain Model: eight Pydantic models (
EditorialBrief,ResearchDossier,ArticleDraft,EditorFeedback,PublishedNewsletter, β¦) that define the contract between stages and the shape of the API response. - Single-Call Pipeline with a Revision Loop:
POST /api/v1/editorial/produce-newsletterruns Researcher β Writer β Editor and returns the complete edition in one response. The Editor acts as a gate: a draft that misses its readability, grounding, or tone gate is sent back to the Writer under tighter limits. The loop is bounded and stops when the gates pass, the budget is spent, or a round changes nothing. The endpoint is total. If the budget runs out with gates still failing, the edition is still returned, carryingrevision_required: trueand a critique naming each failing gate and its margin. - Deterministic Output: identical briefs produce identical editions and identical IDs across processes, which makes the pipeline straightforward to test.
- Interactive Editorial Studio: glassmorphic bilingual (English/Arabic RTL) dashboard that submits a brief and renders the returned edition, research signals, and the editor's critique notes.
- Deployment Manifests: Dockerfile, Compose service, and a Helm chart with
liveness/readiness probes wired to
/healthzand/readyz.
| Capability | Status |
|---|---|
| Typed models & stage hand-off | β Implemented |
| FastAPI gateway, health probes, static dashboard | β Implemented |
| Docker / Compose / Helm packaging | β Implemented |
| Deterministic, reproducible edition IDs | β Implemented |
HTML escaping in html_body |
β Implemented β text nodes are escaped, so a topic carrying markup cannot become live HTML |
| Flesch Reading Ease scoring | β
Implemented β computed from the draft in core/readability.py |
| Fact-check grounding against the dossier | β Implemented β statistics and quotations only, see the caveat below |
| Tone alignment scoring | β Implemented β sentence length and long-word density against a per-tone profile |
| Editor β Writer revision loop | β Implemented β bounded, and reports how many rounds it used |
Brief-driven output (tone, target_word_count) |
β Implemented β tone drives headline, hook, register and the readability floor; word count drives elaboration depth |
| Topic-drift detection | β Implemented β warns when the dossier shares no vocabulary with the brief topic |
| Markdown β HTML compilation | **bold** is not converted), no lists |
| Fact-check coverage | |
| Word-count target | |
| Pluggable model providers | β Implemented β Ollama (local, free), Gemini (free tier), or none. Zero vendor SDKs: every provider is plain HTTP via the standard library |
| Caller-supplied research | β Implemented β POST your own dossier and the fact-check verifies against sources this system did not write |
| Source provenance labelling | β
Implemented β every response says whether research was CALLER_SUPPLIED, MODEL_GENERATED, or the built-in FIXTURE |
| Automatic web research | β Not implemented β a model cannot browse. Model-drafted findings are labelled unverified and are never given fabricated source URLs |
readability_scoreis a real Flesch Reading Ease value. The gate is per tone, not global. A single 80.0 threshold was unreachable: FRE 80β89 is 6th-grade reading level, while this newsletter's stated audience is "CTOs, Founders & Enterprise Architects", which is the 30β59 band.fact_check_passedmeans no unsupported statistic or quotation was found. A draft containing no figures and no quotations has nothing to check, and the critique notes say so explicitly rather than implying verification happened.tone_alignment_scoreis two structural proxies, not a judgement of voice. A draft can score 1.00 and still sound wrong.- Provenance decides what any of it is worth. The Editor verifies the
Writer against the dossier, so the fact-check is only as good as the research
behind it. Against a model-generated dossier,
fact_check_passed: truemeans the Writer copied the Researcher faithfully β nothing about the world. Every response says which case it is, in plain language.
Three ways, none of which cost anything:
| Setup | Key | Cost | |
|---|---|---|---|
| Deterministic (default) | nothing | none | free |
| Ollama | ollama pull llama3.2 |
none | free, local, offline |
| Gemini | free key | GEMINI_API_KEY |
free tier |
COLLABX_PROVIDER=ollama uvicorn collabx.server:app --port 8014
COLLABX_PROVIDER=gemini uvicorn collabx.server:app --port 8014
curl -s localhost:8014/api/v1/providers # which engine is live (never echoes a key)If a provider is unreachable, out of quota, or returns something unusable, the request falls back to the deterministic engine and still succeeds. A missing model degrades the quality of the output, never the availability of the service.
Post your own research and the gate verifies against sources CollabX did not write. This is the mode the project is actually for:
curl -X POST localhost:8014/api/v1/editorial/produce-newsletter \
-H 'Content-Type: application/json' -d '{
"topic": "Regional Dairy Pricing Volatility",
"dossier": {
"dossier_id": "D1",
"topic": "Regional Dairy Pricing Volatility",
"findings": [{
"headline": "Farmgate prices swung sharply in Q3",
"statistic": "Farmgate milk prices moved 12% between July and September.",
"source_url": "https://example.gov/dairy/q3-report",
"verified_quote": "Processors absorbed most of the volatility."
}],
"core_themes": ["Dairy pricing volatility"]
}
}'
SPEC.mddescribes the target design. The revision loop and quality gates it specifies are now built; LLM-backed agents are not.
βββββββββββββββββββββββββββ
β Editorial Brief β
ββββββββββββββ¬βββββββββββββ
β
ββββββββββββββΌβββββββββββββ
β ResearcherAgent β
β β’ Statistics & Quotes β
β β’ Core Themes β
ββββββββββββββ¬βββββββββββββ
β
ββββββββββββββΌβββββββββββββ
β WriterAgent β
β β’ Catchy Hooks β
β β’ Long-Form Narrative β
ββββββββββββββ¬βββββββββββββ
β
ββββββββββββββΌβββββββββββββ
β EditorAgent β
β β’ Readability Scoring β
β β’ HTML Compilation β
βββββββββββββββββββββββββββ
# 1. Clone repository
git clone https://github.com/asadullah48/collabx.git
cd collabx
# 2. Install the package plus test dependencies
pip install -e ".[dev]"
# 3. Run automated test suite
python -m pytest tests -v
# 4. Start local gateway & frontend editorial studio
uvicorn collabx.server:app --host 127.0.0.1 --port 8014 --reloadNo API key, no model download, no configuration. Step 4 serves a working editorial desk.
- Interactive Editorial Studio: http://127.0.0.1:8014/
- Swagger OpenAPI Docs: http://127.0.0.1:8014/docs
- Active provider: http://127.0.0.1:8014/api/v1/providers
https://collabx-gamma.vercel.app β no signup, no key, nothing to install.
- Editorial studio β submit a brief, watch the pipeline run
- Swagger docs β try the API in the browser
- Active provider β reports
"llm_backed": false
The hosted build runs the deterministic engine on purpose. A public URL holding an API key is one crawler away from an exhausted quota, and a demo that returns 500 is worse than no demo. This one cannot break and costs nothing to keep up. Run it locally with a free model to see the LLM path.
Hugging Face Spaces, Render and Fly are covered in DEPLOY.md.
Claims in this README are checked, because an earlier version of this project carried a "200+ tests" badge over a suite of 10 tautological ones.
- 152 tests, run by CI on Python 3.10β3.13, Linux and Windows.
- The wheel is installed to a clean prefix and run from outside the source tree on every CI run. The suite passes whether or not packaging works, because pytest imports from the working directory β this repository has already shipped a build that was broken while every test passed.
- The API is booted and hit with real HTTP requests in CI, not just TestClient.
- Every quality feature is mutation-tested. Reverting readability scoring, grounding, tone scoring, the per-tone floors, the revision loop, HTML escaping, or span protection each turns tests red. A test that still passes with the feature removed is decoration.
- CI never calls a model (
COLLABX_PROVIDER=deterministic), so runs are hermetic: no key, no network, no flake.
- Autonomy β Researcher β Writer β Editor produce a publication-ready newsletter with no human drafting or fact-checking step required.
- Resilience β the Editor's gates (Flesch readability floor, source-traced statistics, a bounded revision loop) run identically whether the prose came from a model or the built-in template engine β the quality guarantee doesn't depend on the LLM being available or even present, which is why it runs with no API key by default.
- Adaptivity β the revision loop sends failing drafts back with the specific critique that failed them, so the Writer adapts its next draft to concrete feedback rather than blindly regenerating.
- Expose the Researcher/Writer/Editor trio as MCP tools so other content-ops agent systems can plug into this same verified pipeline.
- Extend the Kubernetes deployment path (
helm/) already documented with autoscaling per role as newsletter volume grows.
Built by Asadullah Shafique.
π Explore my portfolio showcasing Agentic AI projects and real-world applications: asadullahshafique-devunity.vercel.app
- DevUnity Portfolio: https://asadullahshafique-devunity.vercel.app
- DocuCode: https://github.com/asadullah48/docucode
- PrivateBrain: https://github.com/asadullah48/privatebrain
- ResearchX: https://github.com/asadullah48/researchx
- GraphAI: https://github.com/asadullah48/graphai
- LoopAI: https://github.com/asadullah48/loopai
- HarnessAI: https://github.com/asadullah48/harnessai
- SecureBridge: https://github.com/asadullah48/securebridge
- WorkforceAI Academy: https://github.com/asadullah48/workforceai-academy
- ConciergeAgent: https://github.com/asadullah48/conciergeagent
- ContextX: https://github.com/asadullah48/contextx
- GuardrailAI: https://github.com/asadullah48/guardrailai
- MarketAgentHub: https://github.com/asadullah48/marketagenthub
- WorkforceAI: https://github.com/asadullah48/workforceai
- DomainX: https://github.com/asadullah48/domainx