AI & AUTOMATIONSELF-HOSTING

Comp AI CRM: The Complete Guide to the Open-Source, Agentic-First CRM

Key Takeaways: Comp AI CRM re-architects relationship management from the ground up by treating the CRM as a structured notebook for autonomous, evidence-driven AI agents rather than a passive database with a chatbot wrapper.

What Is Comp AI CRM: The Rise of Agentic-First Relationship Management

Traditional customer relationship management (CRM) systems have historically suffered from a fundamental operational flaw: they are structured databases fronted by input forms, delegating the tedious burden of manual data entry, lead verification, and enrichment to sales representatives. Recent attempts by incumbent platforms to incorporate artificial intelligence have predominantly relied on bolt-on chat interfaces—sidebars that still demand direct human prompting, context re-feeding, and verification.

Comp AI CRM inverts this paradigm entirely. Available as an open-source project on the Comp AI CRM GitHub Repository, it introduces an agentic-first architecture where the AI agent is not a secondary feature of the system. Instead, the CRM database serves as the persistent ledger where the autonomous agent records verified facts, orchestrates follow-ups, and monitors relationship health.

Operating on a background schedule independent of user sessions, the agent leases tasks from a persistent queue, executes targeted investigation routines, allocates a designated research budget, and halts once that budget is consumed. Closing the browser window does not pause execution; the background process continues its work autonomously.

The Core Philosophy: Deterministic Evidence over Generative Hallucination

A prominent vulnerability of large language models in enterprise operations is the tendency to hallucinate plausible yet incorrect details. In enterprise sales, a fabricated phone number, incorrect job title, or misplaced company association creates immediate customer friction.

Comp AI CRM enforces an uncompromising operational rule: nothing about an individual or organization is ever guessed.

The underlying system prohibits tools from utilizing self-reported probabilistic confidence scores. Because language models asked to evaluate their own certainty frequently exhibit bias toward appearing useful, Comp AI CRM removes self-evaluation from the loop. Instead, tools report strictly what they have observed from verified inputs, such as raw email headers, signature blocks, meeting transcripts, and authenticated external profiles.

A deterministic evidence ledger weighs and prices every observation. High-fidelity evidence—such as a direct confirmation found within a customer signature block—is written immediately to the primary record. Ambiguous or weaker signals are quarantined and presented as pending suggestions for a human operator to confirm or reject. In this framework, a blank field is considered vastly superior to an unverified entry.

Deep Architecture: Monorepo, Eve Framework, and Sandboxing

The codebase of Comp AI CRM is organized as a unified monorepo powered by modern TypeScript tooling, designed for enterprise durability and high execution speed.

Monorepo Foundation: Turborepo, Bun, and NestJS

The application suite leverages Turborepo and the Bun runtime to deliver fast compilation and package management. The web frontend is engineered with Next.js using the App Router, providing a reactive interface for sales teams. The backend business logic and API endpoints are powered by NestJS, maintaining strict separation between the relational data models and the asynchronous task worker.

Durable Agent Lifecycle with the Eve Framework

The autonomous agent subsystem resides within its own isolated service layer (apps/agent), constructed using the Eve runtime framework. Rather than ephemeral execution chains that vanish when a server restarts or scales down, Eve treats agents through a filesystem-first abstraction:

  • Authored Tools: Eighteen modular tools handle operations such as reading communication history, performing internal entity matching, identifying company structures, and updating CRM records.
  • Versioned Skills: Procedural instructions—including evidence valuation guidelines, data boundary definitions, and brief writing protocols—are stored as markdown documents checked into source control alongside production code.
  • Durable Sessions: Tasks persist their state across redeployments, resuming execution precisely at the point of interruption without repeating completed tool calls.

Zero-Egress Sandboxes and Credential Isolation

To prevent sensitive customer information from leaking, the agent execution runtime is enclosed within an aggressive sandbox environment. In production deployments, this relies on micro-isolated runtimes; local environments utilize hardened Docker or micro-sandbox containers.

Crucially, the agent sandbox is configured with deny-all network egress. The agent process is never granted direct database connection credentials (DATABASE_URL), nor can its shell environment initiate external HTTP requests. Outbound communication occurs exclusively through strictly scoped runtime proxy tools, eliminating any attack vector where customer email bodies or contact details could be exfiltrated via shell commands.

Non-Blocking Task Queues with Postgres Skip Locked

Task distribution avoids fragile cron wrappers or external distributed queue brokers. Instead, the task scheduler leverages PostgreSQL row-level locks via FOR UPDATE SKIP LOCKED. Multiple worker processes can concurrently lease distinct tasks without collision. If a worker terminates unexpectedly, its leased database row automatically returns to the pool upon lease expiration, ensuring uninterrupted execution across distributed environments.

Comprehensive Installation and Self-Hosting Guide

Deploying Comp AI CRM on your own infrastructure ensures complete custody of customer records and internal communication archives.

Environment Prerequisites

  • Runtime: Bun (v1.1 or higher installed on the host system)
  • Container Engine: Docker and Docker Compose (to run local PostgreSQL)
  • Authentication: Google Cloud Console or Microsoft Entra ID credentials for OAuth SSO
  • External Integrations: Optional API key for company firmographics and profile enrichment from Context Dev

Repository Setup and Dependency Installation

Begin by cloning the source repository to your local workspace and installing the package dependencies:

git clone https://github.com/trycompai/crm.git
cd crm
bun install

Configuring Environment Variables and Better Auth

Copy the template environment configuration file to the project root:

cp .env.example .env

Open .env in your preferred editor and configure the necessary parameters. Authentication is managed via Better Auth, requiring a shared cryptographic secret between the web frontend and API services:

# Generate a cryptographically secure 32-byte secret
openssl rand -base64 32

Assign this generated string to BETTER_AUTH_SECRET across both processes. Ensure that ALLOWED_SIGN_IN is populated with your organization’s allowed corporate domains to restrict access. Additionally, configure AGENT_BRIDGE_SECRET with an identical secret in both frontend and agent configurations to activate real-time agent monitoring.

Database Provisioning, Migrations, and Seeding

Launch the PostgreSQL container using Docker Compose:

docker compose up -d

Once the database container is healthy on port 5432, run the database migrations and apply the initial schema definitions:

bun run db:deploy

To load standard demo records, pipelines, and sample deal stages, run the optional seeding script:

bun run db:seed

Launching Application Services

Start the development server cluster, which orchestrates the Next.js web application, NestJS API, and Eve agent runner concurrently:

bun run dev

Upon successful compilation, access the operational components:

  • Web User Interface: http://localhost:3000
  • API Documentation & Service: http://localhost:3001

Operating Comp AI CRM: Day-to-Day Agentic Workflows

Working with an agentic-first CRM differs markedly from traditional data entry routines.

Navigating the Record-Level Agent Tab

Every contact, company, and deal page includes a dedicated Agent tab. This interface surfaces the underlying cognitive trail of the agent:

  • Exact chronological steps taken during account investigation.
  • Discarded hypotheses and the specific rationale for dropping them.
  • Source provenance for every newly discovered data point.

Autonomous Follow-Ups and Research Budgets

Sales reps do not need to configure complex marketing automation rules for contact re-checks. When an agent discovers that an account is undergoing leadership changes or planning a future procurement review, it executes the schedule_recheck tool. The agent explicitly records its justification (for example, “Re-verifying technical team expansion following Q3 funding round”), which is displayed directly on the rep dashboard.

Human-in-the-Loop Disambiguation

When incoming evidence points equally toward two distinct individuals sharing a common name across corporate divisions, the agent pauses instead of making a probabilistic bet. It posts a disambiguation request within the record timeline, detailing the conflicting observations. Once the sales representative selects the intended profile, the agent resumes its background workflow.

Feature Matrix: Comp AI CRM vs. Legacy Platforms

Architecture DimensionComp AI CRMTraditional Cloud CRMsAI-Wrapper CRMs
Agent ExecutionBackground-durable, autonomousNone (Manual workflows)Session-bound chat prompts
Data VerificationDeterministic evidence ledgerManual user inputProbabilistic model guessing
Sandbox SecurityDeny-all network, credential isolationMulti-tenant cloud accessVariable external API calls
Self-Hosting100% open-source (MIT licensed)Proprietary vendor lock-inProprietary SaaS
Concurrency ModelPostgreSQL Skip-Locked queueBatch API sync schedulesReactive webhooks

Frequently Asked Questions

How does Comp AI CRM prevent AI hallucinations in customer records?

The system completely bypasses model-assigned confidence scores. It relies on a deterministic evidence ledger where only observed, authenticated artifacts (such as email signatures or authenticated profiles) can commit changes to the primary record.

Can Comp AI CRM function without paid third-party data subscriptions?

Yes. The platform operates effectively with zero external data API keys. The internal read_crm_history tool parses your existing communication records, calendar entries, and email signature blocks at zero marginal cost. External data providers can be toggled as optional enhancements.

Is Comp AI CRM suitable for air-gapped enterprise deployments?

Because the core stack runs on Bun, Next.js, and local PostgreSQL containers, the application layer can run on fully private networks. Local or private enterprise LLM gateways can be targeted via standard API configuration endpoints.

Why does the agent sandbox enforce deny-all network egress?

Deny-all egress ensures that raw customer information, meeting notes, and email bodies processed by the agent within the shell environment cannot be transmitted outside the enterprise boundary, maintaining rigorous compliance with corporate privacy policies.

You may also like

Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted