Documentation Index
Fetch the complete documentation index at: https://docs.useterse.ai/llms.txt
Use this file to discover all available pages before exploring further.
Score inbound and outbound contacts automatically when volume is too high for manual review.
Start from a project scaffold
terse init acme-revenue
cd acme-revenue
terse integrate
terse generate
What it does
- Triggers on a new contact in Attio.
- Pulls firmographic context from Apollo.
- Uses the model to assign a score and short rationale.
- Writes the score and rationale back to Attio.
Core workflow
import { createJob, TerseAgent, Trigger } from "terse-sdk"
import { Apollo, Attio, AttioList } from "./terse.generated"
createJob({
name: "contact-scoring",
triggers: [Attio.onRecordCreated({ list: AttioList.Contacts.NewContacts })],
onTrigger: async (event: Trigger) => {
const agent = TerseAgent.create({
prompt: "You score new contacts on fit and explain your reasoning briefly.",
skills: [Attio.skill({ lists: [AttioList.Contacts.NewContacts] }), Apollo.skill()]
})
const company = await agent.tools.apollo.enrichCompany({
domain: event.record.values.company_domain
})
const result = await agent.runAndWait(
[
"Score this contact from 1-100 and explain why.",
`Company: ${event.record.values.company_name}`,
`Domain: ${event.record.values.company_domain}`,
`Industry: ${company.industry}`,
`Employee count: ${company.employeeCount}`,
`Revenue: ${company.estimatedRevenue}`,
`Technologies: ${company.technologies.join(", ")}`
].join("\n")
)
// Parse structured score from model output
const scoreMatch = result.match(/\b(\d{1,3})\b/)
const score = scoreMatch ? parseInt(scoreMatch[1], 10) : 0
await agent.tools.attio.updateRecord({
list: AttioList.Contacts.NewContacts,
recordId: event.record.id,
fields: { contact_score: score, scoring_notes: result }
})
}
})
Customize
- Change the score thresholds to match your routing logic.
- Add Slack or email delivery if high scores should notify a rep immediately.
- Split scoring by persona if your GTM team handles multiple buyer types.
- See structured output for a more robust way to extract typed scores from the model.