.do
Business-as-Code
Business-as-Code is the idea that if a company, it’s Purpose, Goals, Org Structure, Processes, and Workflows can be codified and managed as code, then AI can be used to develop strategies, perform short & long-term planning, define experiments, and execute processes and workflows through the delivery of tasks in a work queue.
For example, imagine a lending broker that acquires traffic of consumers looking for loans, captures credit applications, evaluates credit history, and offers credit terms along with ancillary financial & insurance products and services. If the consumer accepts the offer and provides any requested documentation, the broker verifies identity, income, employment, assets, collateral, residence, and any other stipulation or documentation needed to fund the deal and sell it to a lender.
import { Agent } from 'agents.do'
import { Human } from 'humans.do'
import { Business } from 'workflows.do'
const turboLoans = Business({
name: 'TurboLoans',
url: 'https://turboloans.co',
vision: 'To provide fast, affordable, and transparent loans to consumers',
storyBrand: {
hero: 'Consumers overwhelmed by slow, unclear loan processes',
problem: 'Difficulty securing fair loans due to complicated apps and unclear terms',
guide: 'TurboLoans, your trusted partner in quick, clear loans',
solution: 'AI-driven platform simplifying loan evaluation and approval',
callToAction: 'Apply easily, get approved fast, secure your finances',
success: 'Immediate access to financing and financial peace of mind',
failure: 'Facing delays, hidden costs, and financial uncertainty',
transformation: 'From anxious borrower to financially confident',
},
leanCanvas: {
problem: ['Complex and slow loan approval processes', 'Opaque loan terms and conditions'],
customerSegments: ['Middle-class consumers', 'Young professionals'],
uniqueValueProposition: 'Instant, transparent, AI-powered loan approvals',
solution: ['AI-driven credit evaluation', 'Simplified digital application', 'Real-time approval'],
channels: ['Online advertising', 'Social media marketing', 'Affiliate partnerships'],
revenueStreams: ['Loan origination fees', 'Ancillary financial products'],
costStructure: ['AI development and maintenance', 'Customer acquisition', 'Regulatory compliance'],
keyMetrics: ['Application conversion rate', 'Loan approval time', 'Customer satisfaction index'],
unfairAdvantage: 'Proprietary AI algorithm optimized for speed and accuracy in credit evaluation',
},
goals: {
'Grow market share': ['▲ qualified leads / week', '▲ funded loans / month'],
'Enhance profitability': ['▼ CAC', '▲ approval rate', '▲ net revenue / loan'],
'Delight customers': ['NPS ≥ 75', 'CSAT ≥ 95%'],
},
ceo: Human({ name: 'Alex', email: 'alex@turboloans.co' }),
cmo: Agent({
name: 'Clara',
objective: 'Acquire quality traffic at ≤ $35 CAC',
keyResults: ['▼ CAC', '▲ conversion rate'],
}),
cto: Human({
name: 'Tom',
email: 'tom@turboloans.co',
objective: 'Build the industry-leading digital lending platform',
keyResults: ['▼ avg. decision latency', '▲ automated verifications'],
}),
})
turboLoans.on('CreditApp.Submitted', async (app, { ai, db, taskQueue }) => {
const score = await ai.call('riskScore', {
creditReport: app.creditReport,
income: app.income,
})
const terms = await ai.call('priceLoan', {
score,
amount: app.amount,
term: app.term,
})
await db.loans.update(app.id, { score, terms })
if (score >= 700) {
taskQueue.enqueue('SendOffer', { applicantId: app.id, terms })
} else {
taskQueue.enqueue('RequestDocs', {
applicantId: app.id,
docs: ['paystubs', 'bankStatements'],
})
}
})
turboLoans.on('Docs.Uploaded', async (evt, { ai, db, taskQueue }) => {
const verified = await ai.call('verifyDocs', {
docs: evt.docs,
applicantId: evt.applicantId,
})
await db.docs.update(evt.applicantId, { verified })
verified === true
? taskQueue.enqueue('PrepareFunding', { applicantId: evt.applicantId })
: taskQueue.enqueue('RequestMoreInfo', {
applicantId: evt.applicantId,
missing: verified.missing,
})
})
turboLoans.every('hour', async ({ ai, db, task }) => {
const funnel = await db.loans.funnelMetrics()
const plan = await ai.plan('improveFunnel', funnel)
plan.forEach((action) => task.do(action.type, action.payload))
})
turboLoans.every('day at 07:00', async ({ ai, db }) => {
const yesterday = await db.kpis.snapshot('yesterday')
const todayPlan = await ai.plan('dailyObjectives', {
kpis: yesterday,
okrs: turboLoans.goals,
})
await db.tasks.bulkInsert(todayPlan.tasks)
})
turboLoans.every('week on Mon at 08:00', async ({ ai, db, task }) => {
const progress = await db.kpis.progressAgainstOKRs(turboLoans.goals)
const insights = await ai.call('generateOKRReport', { progress })
task.do('SendReport', { to: turboLoans.ceo.email, report: insights })
task.do('ShareUpdate', {
channel: '#team-turbo',
summary: insights.summary,
})
})