emileriksenkeev links Syd's legal AI with a finance counterpart

The fork lets legal and finance AI systems ask each other questions without requiring a person to shuttle context between them.

integrationworkflow

Syd can now answer legal questions sent by a separate finance AI, drawing on the relevant project, documents and internal knowledge base, then returning cited answers. In the other direction, Syd can consult the finance system and its document register when a legal task needs financial context.

The team has added guardrails to prevent the two systems from endlessly passing a question back and forth. It also keeps long-running requests alive through a hosting limit that otherwise cut off responses before they finished. Spreadsheet uploads were added alongside the integration work.

For organisations building connected legal and finance operations, this is a practical example of joining specialist AI assistants while keeping each one's remit distinct.

So what Legal-ops leaders and product teams with separate legal and finance systems should care: this shows how cross-functional AI assistance can be made more useful without turning into an uncontrolled loop.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

5 commits from emileriksenkeev/sydOS, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
0da8c20b feat(agent): /api/agent/ask - agent-to-agent bridge endpoint for Bry emileriksenkeev 2026-07-15 ↗ GitHub
commit body
Bry (the finance AI in Finance OS) asks Syd legal questions; Syd runs its
normal agentic loop headless (documents, wiki, PH law tools) scoped to the
Corporate Structure V2 project and answers with extracted citations.
Auth: shared AGENT_ASK_KEY via x-agent-key (env; 503 when unset). Machine
path runs thinkingEffort low. Instructions in the caller's question are
treated as data.

Requires on the droplet .env: AGENT_ASK_KEY=<shared secret>
Optional: AGENT_ASK_PROJECT (defaults to 'Corporate Structure V2')

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3ffb886a fix(agent): pin agent-ask to Claude (droplet has no Gemini key) emileriksenkeev 2026-07-15 ↗ GitHub
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
600e5283 Bridge A: whitespace-heartbeat on /api/agent/ask to survive Cloudflare's 120s cap emileriksenkeev 2026-07-16 ↗ GitHub
commit body
Syd's agent loop runs 1-2 min headless, but api-legal.rxventures.co is fronted by
Cloudflare, whose 120s edge Proxy-Read-Timeout kills the connection with Error 524
before Syd finishes - Bry's ask_syd hop then reports "Syd answered 524". The zone is
Free-plan and api-legal is a cloudflared tunnel, so the timeout can't be raised and
grey-clouding isn't available.

Cloudflare resets that read timeout on every byte from the origin, so trickle a
whitespace keepalive to the client while the loop runs, then send the JSON at the end.
JSON.parse ignores leading whitespace, so Bry's `await res.json()` parses it unchanged
- no Finance OS change needed. Lazy by design: only streams if the work passes ~90s,
so fast responses and errors keep their normal status codes. Calls res.flush() after
each write because the app gzips JSON (compression middleware would otherwise buffer
the keepalive, same reason the SSE path skips compression).

Keeps the cloudflared tunnel and CF WAF intact - no droplet exposure, no plan upgrade.
Deploy: git pull && npm --prefix backend run build && restart node dist/index.js.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
e4a79600 Merge pull request #1 from emileriksenkeev/fix/syd-agent-ask-heartbeat emileriksenkeev 2026-07-16 ↗ GitHub
Bridge A: whitespace-heartbeat on /api/agent/ask to survive Cloudflar...
98f01cf2 Syd→Bry reverse bridge + spreadsheet document support emileriksenkeev 2026-07-16 ↗ GitHub
commit body
Lands the pending work built in the finance-os sessions on 2026-07-16:

- lib/bryBridge.ts: ask_bry (POST ${BRY_AGENT_URL}/api/bry/ask, shared
  AGENT_ASK_KEY, depth guard - Bry strips its own ask_syd at depth>=1)
  plus list/search/read_bry_documents direct reads of Finance OS's
  document register. Wired into global and project chat only;
  routes/agentAsk.ts deliberately excludes BRY_TOOLS so a Bry-initiated
  hop can never ping-pong back. All fail soft when env is unset.
- xlsx/xls/csv uploads: ALLOWED_TYPES + content types + LibreOffice PDF
  renditions; lib/xlsxText.ts extracts sheet text for chunking/embedding
  (legacy .xls goes through the PDF rendition like .doc).
- .env.example documents the new droplet vars: BRY_AGENT_URL,
  FINANCE_SUPABASE_URL, FINANCE_SUPABASE_KEY.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-921.md from inside the repo you want the changes in.

⬇ Download capture-thread-921.md