An npm package that separates “when to speak” from “how to present” in AI companion products deserves our attention: such open-source components are turning the chat interface from a core capability into a replaceable shell.

What this is

@yanisjiang/companion-core is an open-source TypeScript component from YanisJiang. It first generates an intent based on states such as personality, energy, mood, and social desire, including staying silent, providing companionship, continuing daily life, or postponing a response. It calls a large language model only when output is needed. Developers can connect any OpenAI-compatible model, message storage, and character configuration, then deploy the same logic across websites, instant-messaging bots, game NPCs, or proprietary backends.

It is not a general-purpose Agent framework. It does not query databases, call external tools, or execute multi-step workflows, and it provides no login, web push, domain, or deployment solution. The official website and PWA are merely example hosts; the core package can be used independently.

Industry view

This separation has practical value: conversational rhythm is no longer bound to the frontend, and changing models, channels, or business systems does not require rewriting state logic. In particular, deciding whether to call a model first can reduce meaningless responses and token consumption. Products that need stable behavior, such as game characters and long-term companion assistants, need this abstraction layer more than a conventional chat shell does.

The risks are equally clear. Products must validate whether the state is credible, whether users interpret silence as a malfunction, and whether long-term character interaction creates dependency. The project currently leans toward a single-user, self-hosted tool, while its example completeness, interface stability, test coverage, and community maintenance capacity remain insufficiently demonstrated. Before enterprise adoption, teams must also assess upgrade costs, privacy and data storage, auditing, and prompt-injection security. Reusable open-source code does not mean the project already constitutes a mature commercial solution.

Impact on regular people

For enterprise IT: Teams with existing customer-service, assistant, or game-dialogue systems can decouple state decisions from model generation and avoid duplicated development across multiple endpoints. Production deployment, however, still requires them to add authentication, monitoring, data compliance, and cost controls themselves.

For individual professionals: Nontechnical employees familiar with APIs and Node.js can build prototypes with character memory and proactive interaction rhythms more quickly. This does not automatically produce a maintainable commercial system, however; model fees, servers, and testing remain the user's responsibility.

For the consumer market: The differentiation among companion applications may increasingly come from “when to respond, what to remember, and how to end an interaction,” rather than response quality alone. If similar cores become widespread, websites, desktop apps, and robots may share the same character state, giving users a more consistent experience as they switch between entry points.