metal-kompanion/integrations/js
Χγφτ Kompanion db01fb0485 Add missing files 2025-10-16 03:46:06 +13:00
..
README.md Add missing files 2025-10-16 03:46:06 +13:00
demoMemoryExchange.js Add missing files 2025-10-16 03:46:06 +13:00
kompanionMemoryClient.js Add missing files 2025-10-16 03:46:06 +13:00
package.json Add missing files 2025-10-16 03:46:06 +13:00

README.md

JavaScript Bridges

This folder contains JavaScript helpers that talk to the Kompanion MCP runtime. They are intended for quick prototyping – copy the files into a Node.js project and adjust them to your local workflow.

Prerequisites

  • Node.js 18+
  • kom_mcp built from this repository (cmake --build build --target kom_mcp)
  • Optional: PG_DSN environment variable exported so Kompanion can reach your personal database.

Usage

  1. Install dependencies.

    npm install
    

    (The helper only uses built-in Node modules, but this sets up a working package.json.)

  2. Run the demo to save and recall memory via MCP:

    node demoMemoryExchange.js
    
  3. Wire the exported helpers into your own automation. The module exposes saveContext, recallContext, and searchMemory, each returning a parsed JSON object.

Connecting to the Personal Database

The helper shells out to the kom_mcp CLI, so all database access flows through Kompanion’s DAL. As long as the CLI can reach Postgres (or the in-memory stub), JavaScript code automatically benefits from the same storage layer and policy.

If you need raw SQL access, you can extend the module with pg or any other driver – this scaffolding is kept simple on purpose so it works out-of-the-box without additional dependencies.