Loading repository data…
Loading repository data…
guillempuche / repository
Open-source CRM with a built-in research agent. Find people, email them, follow up, remember the trail. Your providers, your budget. MCP-ready, MIT.
An open-source CRM with a built-in research agent. Find people, email them, follow up, and remember the trail.
I built Batuda for the cases where a CRM that just stores the row isn't enough. I wanted the same tool to go look the row up — read a company's site, find the right contact, summarise the competitor — and hand me a structured result I could act on, on my own search + LLM keys, on a budget I set per user.
prospect_scan, company_enrichment, contact_discovery, competitor_scan) or go freeform. Each run lands as a structured record on a company, with per-user budgets, monthly caps, and explicit approval over the auto-approve threshold. Caching at every layer (search, scrape, extract, LLM) so re-runs don't re-spend.The same job — find someone, contact them, remember what happened — shows up in dozens of shapes. The ones I had in mind:
One instance, many workspaces. Run it alone, run it for a team, or host several workspaces under one roof.
SearchProvider, ScrapeProvider, ExtractProvider, DiscoverProvider, plus three language-model roles (AgentLanguageModel, ExtractLanguageModel, WriterLanguageModel). Brave wired today. Per-user policy in user_research_policy, clamped against a system hard ceiling. Hierarchical parent/child runs. Streaming SSE events you can watch live.CompanyEnrichmentV1, CompetitorScanV1, ContactDiscoveryV1, ProspectScanV1, Freeform. The agent returns a record, not prose.mail-worker process. Credentials AES-256-GCM-encrypted per inbox. Outbound via SMTP, footer injection, draft staging.search_companies, log_interaction, create_research, send_email, …), slug-completion resources, and guided prompts. Claude, ChatGPT, and n8n use the same surface you do.ca/es/en) when you want a public landing for a workspace.| Project | Web research | Open source | Provider choice | Budget control | First-party MCP |
|---|---|---|---|---|---|
| Batuda | First-class service + 5 typed schemas | MIT | Pluggable ports | Per-user policy + cap | Yes |
| Attio | Workflow block on a record | Closed | Their stack | AI credits | Yes |
| Folk | "Research Assistant" | Closed | Their stack | Per-plan | Community wrappers |
| Lightfield | Code execution over interaction memory | Closed | Their stack | Per-seat | Listed |
| Reevo | Bundled prospect DB, light "research" | Closed | Their stack | Seat + credits | None mentioned |
| Twenty | None as first-class (workflow ai-agent) | Custom OSS | Vercel AI SDK | None | Yes |
| Atomic CRM | None | MIT | n/a | n/a | OAuth + RLS proxy |
| EspoCRM / Suite | None | AGPL | n/a | n/a | None |
The combination no one else ships in one tool: MIT + your provider keys + per-user budget caps + typed research schemas + intent-level MCP. Full surface-by-surface comparison: docs/crm-competitor-analysis.md.
Status. Pre-1.0. Schema rewrites happen in a single
0001_initial.tsmigration; expect breaking changes between releases until I cut a stable version.
| Layer | Technology |
|---|---|
| Monorepo | pnpm workspaces + Turborepo |
| Dev environment | Nix flake (Node 24 + pnpm + kraft) |
| Shared schema | packages/domain — Effect Schema |
| CLI | apps/cli — Effect CLI + @clack/prompts TUI |
| Backend | apps/server — Effect HTTP + MCP server |
| Web app | apps/internal — TanStack Start |
| Shared UI | packages/ui — MD3 design tokens + BaseUI + Tiptap |
| Database | Postgres (NeonDB) |
| Deploy | Unikraft via kraft CLI |
| Code quality | Biome (lint + format) + dprint (markdown) |
Requires: Node 24, pnpm 10, Docker + Docker Compose. If you use Nix, nix develop drops you into a shell with Node + pnpm already pinned.
nix develop # or: install Node 24 + pnpm manually
pnpm install # install dependencies
pnpm cli setup # copy .env files from .env.example
pnpm cli services up # start Postgres + MinIO via Docker
pnpm cli db migrate # create CRM + auth tables
pnpm cli auth bootstrap # create first admin (interactive)
pnpm cli doctor # verify everything is healthy
# in 2 terminals:
pnpm dev:server # API + MCP server
pnpm dev:internal # Batuda web app
First time? See the detailed walkthrough for explanations of each step, env var guidance, and troubleshooting.
# CLI
pnpm cli setup # copy .env files from examples
pnpm cli doctor # check environment health
pnpm cli seed # insert sample data (Taller fictitious tenant)
pnpm cli db migrate # run database migrations
pnpm cli db reset # drop schema + re-migrate (chain `pnpm cli seed` for sample data)
pnpm cli services up # start Docker services
pnpm cli:tui # interactive TUI menu
# Development
pnpm dev:server # start API + MCP server
pnpm dev:internal # start Batuda web app
# Build & lint
pnpm build # build all packages
pnpm lint # lint + format
pnpm check # lint + format (CI mode)
Run it
Understand the architecture
Strategic context
Operate it
Contribute
Contributions are welcome. Please open an issue first to discuss what you'd like to change.