Skip to content

About

Human-in-the-loop songwriting for Gen AI Music: the AI argues, you rewrite. Every line tagged human or machine, tracked past 51% — authorship you can prove, not just claim. Multi-agent LangGraph + FastAPI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

Repository files navigation

Creative Prosthesis

Two AI songwriting apps you can run in about a minute — one command, one API key.

A weekend proof-of-concept by Nathan Verrill / Azro Leclaire. I wanted help writing lyrics, so I built two different takes on what "AI co-writer" could mean — one that roasts your draft, one that runs a whole writers' room — and kept the authorship visible in both.


🚀 Run it

You need Docker and an OpenAI API key. That's the whole list.

git clone https://github.com/nathanverrill/creative-prosthesis.git
cd creative-prosthesis
cp .env.sample .env          # paste your OPENAI_API_KEY into .env
docker compose up --build

Both apps start together. Open either one:

The Roast http://localhost:8000 You give it a theme. It researches, writes a draft, hands it to a George Carlin-style critic who tears it apart, then rewrites the song answering the critique. One pass, ~15 seconds.
The Writers' Room http://localhost:8001 A room of six agents. Three personas argue about your draft in parallel — Yes-And escalates, No-But roasts and fixes, Non-Sequitur derails — then a panel scores it and sends it back for another revision until it clears the bar. ~30-70 seconds.

Type any theme — lando wins, my landlord never fixes the boiler, quantum physics — and press Generate Lyrics.

OPENAI_API_KEY is the only required setting. Everything else in .env.sample is commented out; without a web-search key the apps write from the model's own knowledge instead.

In the repo these live in agentic-lyrics/ (The Roast) and ai-songwriter-prosthesis/ (The Writers' Room). Each has its own README.


👀 What you actually see

A live console streams every agent as it works — who is writing, who is arguing, what the critics scored, and whether the song gets sent back for another revision:

15:33:42  Collaborator   Writing the draft
          produced 12 lines
          Lando cruisin' through the Dutch rain squall,
15:33:44  Non-Sequitur   Throwing in something sideways
          LATERAL INPUT: "A giraffe in a tuxedo serenading a toaster on Mars."
15:33:45  No-But         Pushing back
          CRITICAL: No, but this rhyme's lazier than sloth in sweatpants,
15:33:51  Critics        Scoring creativity, freshness and humor
          scores  creativity 0.80  freshness 0.70  humor 0.90  qa pass
15:33:51  Router         thresholds met -> release

Then the song lands in a side-by-side editor. Every line is tagged human or machine, and a counter tracks how much of it you have rewritten — the idea being that authorship should be visible in the data, not just asserted in a license.


🎛 How they work

The Roast — a linear pipeline you can re-order

agentic-lyrics/ · Four steps, wired in sequence. The sequence is data, not code: edit agentic-lyrics/config.yaml and the graph rebuilds itself on restart. Comment out the critic and the song ships unchallenged; add a step and it joins the chain.

research → run_songwriter → run_carlin_critic → run_refiner

The critic is prompted as George Carlin — precise about language, allergic to clichés — and it does not go easy on you:

"Oh, where to even start with this motley collection of pedestrian racing metaphors? 'Engines roar' and 'hungry for more' — congratulations on scraping..."

Roughly 3 model calls.

The Writers' Room — a multi-agent loop with a quality bar

ai-songwriter-prosthesis/ · Eight agents, written as a comedy writers' room in the house style of The Lonely Island. Three brainstorm personas run in parallel and disagree with each other on purpose:

Persona Its job in the room
Yes-And Improv rule one — affirms the gag, then escalates it somewhere wilder
No-But Roasts the weak lines ("this rhyme's lazier than sloth in sweatpants"), then pitches the fix
Non-Sequitur Drops one absurd unrelated spark to knock the song sideways
Researcher Gets the facts the song is built on
Fact Checker Verifies the draft against those facts
Critics A panel scoring creativity, freshness and humor, with a release-or-revise verdict
researcher → collaborator ─┬→ yes_and       ─┐
                           ├→ no_but         ├→ aggregate → fact_check → critics
                           └→ non_sequitur  ─┘                              │
                                    ▲                            revise ←───┤
                                    └─────────────────────────────          │
                                                                 release → END

The router releases only when creativity, freshness and humor all clear their thresholds and the fact-check passes — otherwise the draft goes back to the collaborator, up to five times.

Both apps serve the same editor UI and the same POST /generate contract, so the frontend is interchangeable between them.


🔌 Bring your own model

There is no provider-specific code. The LLM is selected entirely by environment variables, so any OpenAI-compatible endpoint works — OpenAI, a local Ollama or vLLM server, LM Studio, Together, OpenRouter:

OPENAI_API_KEY=sk-...
OPENAI_BASE_URL=https://api.openai.com/v1   # optional, this is the default
LLM_MODEL=gpt-4o-mini                       # optional

Running entirely offline on a local model? Point at your own server and use any placeholder key — local servers ignore it. From inside Docker, reach the host via host.docker.internal:

OPENAI_API_KEY=local
OPENAI_BASE_URL=http://host.docker.internal:11434/v1   # Ollama
LLM_MODEL=llama3.1:8b

Structured output is parsed from the model's text rather than via OpenAI function-calling, so endpoints without tool support still work.

Optional settings

Variable Effect if unset
SERPAPI_API_KEY Apps write from model knowledge instead of live web search
LLM_MODEL_CREATIVE / LLM_MODEL_RESEARCH The Writers' Room uses LLM_MODEL for both roles
MAX_REVISIONS Revision cap defaults to 5
ENABLE_TRACING Phoenix/OpenTelemetry tracing stays off

Keys are injected at run time via env_file and never baked into the images (.dockerignore excludes .env). .env is gitignored; .env.sample is the template.

Running one app at a time

docker compose up lyrics        # just The Roast, port 8000
docker compose up songwriter    # just The Writers' Room, port 8001

🛠 Built with

FastAPI · LangChain · LangGraph · langchain-openai · Server-Sent Events · Tailwind CSS · vanilla JS · Docker Compose

⚠️ Status

Weekend proof-of-concept, not a product. It works end to end and is worth clicking through, but there are no tests, no auth, and CORS is wide open. Treat it as a sketch of the idea.


🤝 Shared Principles of Ownership

Creative Prosthesis is released as open-source software to empower creators and invite collaboration. While the Apache License allows unrestricted integration, we hope you will join us in upholding a simple principle: that individuals retain ownership of the works they create with these tools.

If you build applications or services using Creative Prosthesis, we ask — in the spirit of open authorship — that you respect and protect your users' rights to their own generated works. In doing so, you help advance a broader cultural and legal recognition of human authorship in AI-assisted creativity.

This project also exists to inspire thoughtful discourse around digital property rights, creative agency, and the evolving definition of authorship in the age of machine collaboration. By engaging with Creative Prosthesis, you contribute not only code or art, but to the conversation shaping the future of creative ownership.

🧠 License

  • Code: Apache License 2.0
  • Documentation: Creative Commons Attribution 4.0 International (CC BY 4.0)

If you're interested in collaborating, attribution, or research citation, please credit:

Leclaire, A. (2025). Creative Prosthesis: AI-Driven Composition and Code-Based Music Generation. Azro Leclaire LLC (Missouri, USA).

About

Human-in-the-loop songwriting for Gen AI Music: the AI argues, you rewrite. Every line tagged human or machine, tracked past 51% — authorship you can prove, not just claim. Multi-agent LangGraph + FastAPI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages