vecDot (core/physics.ts)

hippo-memory · src/core/physics.ts · typescript · MIT
ai

TypeScript physics engine utilities for vector math, forces, and simulation of memory particles.

// Source: https://github.com/kitfunso/hippo-memory | License: MIT | Copyright 2026 Keith So
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Memory-as-Physics engine: pure math (forces, Velocity Verlet integration, physics-based scoring, cluster
 * amplification), no I/O.
 * Memories are particles on the unit hypersphere in embedding space (384-dim); query gravity, attraction, conflict
 * repulsion and drag act on them,
 * and nearby high-scoring memories amplify each other. */

import { cosineOf } from './cosine.js';
import { evalNow, isRecallBoostAblated, strengthAblation } from './ablation.js';
import { calculateStrength, FALLBACK_HALF_LIFE_DAYS, type EmotionalValence, type MemoryEntry } from './memory.js';
import { DAY_MS } from '../util/time.js';
import type { 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key