Can AI Chat Windows and Enterprise Systems Share Code? One Developer's Answer
This week an open-source CRM project delivered an atypical answer: HTTP endpoints and AI Agent tools call the same set of business functions (the domain layer, the middle tier that holds core rules), and the whole thing compiles into a standalone binary—no Node or other runtime needed. The project is called Lume CRM, and the code is fully open source.
What this is
Lume is a server-side framework. Three .lume files carry the entire CRM backend: HTTP routing (mapping URLs to handler functions), SQL (database queries), Agent tools, and SSR pages (server-side rendering, where the server generates complete HTML before sending it to the browser) all live inside, and the compiled output is a standalone executable.What the project is trying to validate is not "use Lume to do CRUD (create, read, update, delete)," but an architectural hypothesis: can web requests and AI Agent (an autonomous LLM-driven program) operations enter the same set of business logic directly?The concrete approach: the domain function add_customer is called by two entry points at once—the frontend POST /api/customers and the model's crm_add_customer tool call. Customer validation, SQL, and permissions exist as a single code path. There is no "what the AI sees" versus "what the system has."
Industry view
The case for it: under the legacy architecture, business systems serve employees while AI serves chat windows—two codebases running in parallel, and it's common for "what the AI tells the customer" to be unfindable in the information system. Shared business functions bind the AI to the rules by default, which is in principle more controllable.The case against it: this is a single developer's project, with no validation from a large enterprise deployment. "One codebase, two entry points" looks clean on a small CRM, but what happens when you drop it onto an ERP (enterprise resource planning, integrated software covering finance, procurement, and inventory) or a financial core system is unknown. Exposing business functions directly to the model as tool calls opens up permission boundaries, input validation, and audit traceability as fresh engineering problems, and it cannot be casually equated with "writing one less copy."
Impact on regular people
- For enterprise IT: when choosing AI tools going forward, it is worth asking—whether the AI runs an independent logic layer, or calls the business system's interfaces directly? This decides whether an AI error is a model "hallucination" (fabricated answers with no grounding) or a "system fault."- For individual careers: once AI Agents enter CRM and ERP, they will see the same data and the same rules as employees, but the trigger conditions and the responsibility lines differ, and the boundaries need to be thought through in advance.- For the consumer market: no direct impact on consumers right now, but if "AI calling business functions directly" becomes the mainstream pattern, future AI customer support will no longer be a standalone chatbot—it will share its nervous system with the company's internal systems.