One capability of Lyvica: an autonomous agent that finds a prospect, builds & ships them a website, and cold-emails it — with no human in the loop.
This repo is a deep, single-workflow slice: a local business with a poor or missing web presence goes in; an autonomous Claude agent reasons about them, records them in a CRM, writes and actually sends a personalized cold email, and pings the team on Slack — every external action executed through Composio. It does, it doesn't just chat.
Given a hardcoded sample prospect, the agent runs this loop autonomously:
- Reasons about the prospect and picks a pitch angle.
- Builds & ships a real website — generates a tailored, responsive landing page, commits it
to a new public repo and enables GitHub Pages so it goes live
(
GITHUB_CREATE_A_REPOSITORY…·…CREATE_OR_UPDATE_FILE_CONTENTS·…CREATE_A_GITHUB_PAGES_SITE). - Writes + sends a cold email autonomously via Gmail (
GMAIL_SEND_EMAIL) — leading with the live site URL, no confirmation step. - Schedules a follow-up in Google Calendar (
GOOGLECALENDAR_CREATE_EVENT). - Tracks the lead in a Notion database (
NOTION_INSERT_ROW_DATABASE; auto-creates the "Leads" DB on first run) — one filterable row per prospect. - Remembers the prospect in XTrace — facts + an episode for the run.
→ Four distinct external apps (GitHub, Gmail, Google Calendar, Notion), all via Composio, plus fully autonomous terminal actions: it ships a live site and sends the email — no human gate.
Phase 3 (
npm run phase3) also runs: a stateful reply loop that recalls the prospect from XTrace across runs, then books a meeting (Calendar) + sends a confirmation (Gmail) when they reply, and records the new "interested" status to memory. (XTrace fact linkage / supersession is server-side and best-effort on holistically-extracted facts.)
data/prospect.json
│
▼
src/index.ts ──► src/agent.ts (the loop: Claude ⇄ Composio)
│ │
│ ├─ fetch tools composio.tools.get() ┐
│ ├─ Claude emits tool calls │ src/composio.ts
│ ├─ execute each call composio.tools.execute() ┘ (every external action)
│ └─ feed results back, repeat until the agent stops
│
└──► src/memory.ts XTrace ingest → facts + episode (server-extracted)
src/logger.ts ── every tool call & memory write → stdout + logs/run-<id>.jsonl
- Agent loop:
src/agent.ts— the well-commented showcase. A manual, streamed tool-use loop onclaude-opus-4-8with adaptive thinking. - Execution layer:
src/composio.ts— Composio is the only way external apps are touched. The Anthropic provider hands Claude tools already shaped for its Messages API. - Memory:
src/memory.ts— XTrace; supersession is automatic when a contradicting fact is ingested (used in Phase 3). - Trace:
src/logger.ts— one funnel; every call is timestamped to stdout and JSONL.
Requires Node 20+.
npm install
cp .env.example .env # then fill it inFill .env:
| Var | What |
|---|---|
ANTHROPIC_API_KEY |
Claude (the agent LLM). |
COMPOSIO_API_KEY |
Composio (tool execution). |
XTRACE_API_KEY / XTRACE_ORG_ID |
XTrace memory (xtk_… / org_…). |
NOTION_PARENT_PAGE_ID |
A Notion page id your Composio Notion connection can write under. |
COMPOSIO_USER_ID |
Optional; the Composio identity owning the connections (default default). |
Connect the toolkits for that user before running — npm run connect mints one-click
OAuth links for GitHub, Gmail, Google Calendar, Notion (npm run check verifies them;
npm run disconnect revokes). The agent sends from the connected Gmail account and
publishes the site under the connected GitHub account; the sample prospect's email is set to
your own inbox so the autonomous send is visible.
npm run startOne command runs the full autonomous workflow on the sample prospect and writes a trace.
Every run writes logs/run-<timestamp>.jsonl — one JSON object per line, proving the
agent made each API call itself. Entry types include tool.call (slug + inputs),
tool.result (success, latency, Composio logId), memory.write.done, and run.end.
{"ts":"…","type":"tool.call","slug":"GMAIL_SEND_EMAIL","args":{"recipient_email":"…","subject":"…"}}
{"ts":"…","type":"tool.result","slug":"GMAIL_SEND_EMAIL","ok":true,"ms":812,"logId":"…"}src/
index.ts orchestrator: wire deps, run the loop, persist memory, print summary
agent.ts the autonomous Claude ⇄ Composio tool-use loop ← core showcase
composio.ts Composio client + traced tool fetch/execute
memory.ts XTrace ingest / recall
logger.ts centralized JSONL + stdout trace logger
config.ts model constant + env
prospect.ts sample-prospect loader
data/prospect.json the hardcoded demo input
logs/ per-run execution traces