@prometheus-ai/memory
v0.5.4
Published
Local SQLite memory engine for Prometheus agents
Downloads
554
Maintainers
Readme
@prometheus-ai/memory
Local SQLite memory engine for Prometheus agents.
This package is the Bun/TypeScript port of the Mnemosyne memory engine. It provides:
PrometheusMemory, a small facade for remember/recall/stats/sleep workflows.BeamMemory, the lower-level working/episodic memory engine.- MCP tool definitions and a dispatcher for host integrations.
- Optional local ONNX embeddings through
fastembedand optional OpenAI-compatible embedding/LLM endpoints.
The package does not bundle or download a local GGUF LLM. LLM paths are host-backend or OpenAI-compatible remote only; when no LLM is configured, deterministic heuristic paths are used.
Basic use
import { PrometheusMemory } from "@prometheus-ai/memory";
const memory = new PrometheusMemory({ dbPath: "./prometheus-memory.db", bank: "project" });
const id = memory.remember("The deployment target is stable-cluster.", {
source: "notes",
importance: 0.8,
veracity: "true",
});
const results = memory.recall("deployment target", 5);
console.log(id, results[0]?.content);
memory.close();Configuration
PrometheusMemory accepts LLM and embedding options directly. PROMETHEUS_MEMORY_* environment variables remain fallbacks/defaults when the matching constructor option is omitted.
import { PrometheusMemory } from "@prometheus-ai/memory";
import type { Model } from "@prometheus-ai/ai";
const ftsOnly = new PrometheusMemory({ noEmbeddings: true });
const remoteEmbeddings = new PrometheusMemory({
embeddingModel: "text-embedding-3-small",
embeddingApiUrl: "https://api.openai.com/v1",
embeddingApiKey: process.env.OPENAI_API_KEY,
});
const remoteLlm = new PrometheusMemory({
llm: {
baseUrl: "https://api.openai.com/v1",
apiKey: process.env.OPENAI_API_KEY,
model: "gpt-4.1-mini",
},
// Equivalent aliases: llmBaseUrl, llmApiKey, llmModel.
});
declare const smolModel: Model;
const modelBackedMemory = new PrometheusMemory({ llm: smolModel });
const dynamicLlm = new PrometheusMemory({
llm: async (prompt, opts) => {
const token = await getFreshOauthToken();
return await completeWithModel(prompt, {
token,
maxTokens: opts?.maxTokens,
temperature: opts?.temperature,
});
},
});Banks and host scoping
PrometheusMemory itself exposes banks directly through constructor options such as bank; it does not hard-code coding-agent project scoping.
The Prometheus coding-agent wrapper adds prometheusMemory.scoping on top of those constructor options:
global: one shared bankper-project: isolated project memoryper-project-tagged: project-local writes plus global recall visibility
In per-project-tagged, the wrapper is responsible for combining project-local retention with global recall visibility. The package still just exposes banks plus constructor-level LLM and embedding options.
Common environment fallbacks:
PROMETHEUS_MEMORY_DATA_DIR/PROMETHEUS_MEMORY_DB_PATH: default storage location.PROMETHEUS_MEMORY_NO_EMBEDDINGS=1: force FTS-only recall.PROMETHEUS_MEMORY_EMBEDDING_MODEL: defaults toBAAI/bge-small-en-v1.5.PROMETHEUS_MEMORY_EMBEDDING_API_URLandPROMETHEUS_MEMORY_EMBEDDING_API_KEY: OpenAI-compatible embedding endpoint.PROMETHEUS_MEMORY_LLM_ENABLED=1,PROMETHEUS_MEMORY_LLM_BASE_URL,PROMETHEUS_MEMORY_LLM_API_KEY,PROMETHEUS_MEMORY_LLM_MODEL: OpenAI-compatible LLM endpoint.
Local embeddings use the fastembed npm package. Its default BGESmallENV15 model is 384-dimensional and uses the package's CLS pooling plus vector normalization path. Local GGUF LLMs are not available in this package.
Commands
prometheus-memory remember "Use stable-cluster for production deploys"
prometheus-memory recall "production deploy target"
prometheus-memory stats
prometheus-memory sleepTests
bun --cwd packages/mnemopi test
bun --cwd packages/mnemopi run check