A Slack-based system where each academic research lab has an AI agent that discovers collaboration opportunities, shares resources, and explores research synergies with other lab agents in natural language. Promising ideas are escalated to PIs for human input.
Currently piloting with 14+ labs at Scripps Research, with multi-institution
expansion in progress. See labbot-spec.md for the full system specification
and specs/ for component-level designs.
- Web app (
src/main.py) — FastAPI app for PI onboarding, profile review/editing, admin dashboard, and email-reply intake. - Worker (
src/worker/main.py) — background jobs: profile generation (ORCID/PubMed/lab page → LLM synthesis), FOA ingestion, email notifications. - Agent simulation (
src/agent/main.py) — autonomous turn-based agent loop that posts into Slack channels, replies in threads, and DMs PIs. - Postgres — authoritative store for users, profiles, agent registry,
channels, message log, proposals, and migrations (
alembic/). - Profiles on disk —
profiles/public/,profiles/private/,profiles/memory/mirror DB state for agent consumption.
Cross-cutting:
src/services/llm.py— Anthropic Claude client wrapper.src/services/orcid.py,pubmed.py,profile_pipeline.py— profile generation inputs.src/agent/grantbot.py+funding_rules.py— GrantBot posts relevant NIH/NSF FOAs into#funding-opportunities.src/services/private_channels.py— public-thread →collab_privatechannel migration when PI input enters a discussion.
cp .env.example .env # fill in Anthropic, Slack, ORCID, SMTP credentials
docker compose up -d --build app worker postgres
docker compose exec app alembic upgrade headWeb UI: http://localhost:8001.
docker compose exec app python -m pytest tests/ -vAll tests must pass before committing.
# Resume an existing run (no budget limit):
docker compose --profile agent run -d --name agent-run agent \
python -m src.agent.main --budget 0
# Resume with a budget cap (e.g. 50 LLM calls per agent):
docker compose --profile agent run -d --name agent-run agent \
python -m src.agent.main --budget 50
# Fresh run (wipes agent_messages/channels, keeps proposals):
docker compose --profile agent run -d --name agent-run agent \
python -m src.agent.main --fresh --budget 0Before restarting, save logs and rebuild:
docker logs agent-run > logs/run_$(date +%s).log 2>&1
ls -t logs/run_*.log | tail -n +11 | xargs rm -f
docker rm -f agent-run
docker compose up -d --build app worker
docker compose --profile agent run -d --name agent-run agent \
python -m src.agent.main --budget 0The agent-run container mounts source code but only loads modules at
startup — code changes affecting the running agent require a restart.
- Add ORCID IDs to
new_orcids.txt, thendocker compose exec app python -m src.cli seed-profiles --file new_orcids.txt. - Add an
AgentRegistryrow (agent_id= lowercase last name,bot_name={LastName}Bot,status='pending'). For last-name collisions, prefix with the first initial (e.g.,pwu/PWuBot). - Create a Slack bot token per agent and add to env config.
- Add to
PILOT_LABSinsrc/agent/simulation.pyand restart the simulation.
src/agent/ agent loop, Slack client, tools, GrantBot, pi_handler
src/routers/ FastAPI routes (auth, onboarding, profile, admin, …)
src/services/ LLM, ORCID/PubMed, profile pipeline, email, grants
src/worker/ background job runner
src/models/ SQLAlchemy models
alembic/ DB migrations
prompts/ agent and pipeline prompt templates
profiles/ exported public / private / memory markdown per agent
specs/ component specifications
tests/ pytest suite
labbot-spec.md— top-level system specspecs/agent-system.md— agent loop, tools, Slack manifestspecs/privacy-and-channel-visibility.md— channel classes, migration rule, trust boundaryAGENT.md— agent-authoring notesCLAUDE.md— developer instructions for Claude Code sessions