|
|
||
|---|---|---|
| .. | ||
| README.md | ||
| demoMemoryExchange.js | ||
| kompanionMemoryClient.js | ||
| package.json | ||
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_mcpbuilt from this repository (cmake --build build --target kom_mcp)- Optional:
PG_DSNenvironment variable exported so Kompanion can reach your personal database.
Usage
-
Install dependencies.
npm install(The helper only uses built-in Node modules, but this sets up a working package.json.)
-
Run the demo to save and recall memory via MCP:
node demoMemoryExchange.js -
Wire the exported helpers into your own automation. The module exposes
saveContext,recallContext, andsearchMemory, 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.