Show HN: Open-source toolkit for AI memory that scales
Lithium is an open-source toolkit designed for AI memory that scales effectively. It utilizes PostgreSQL's ltree for efficient tree-structured data retrieval and includes built-in versioning. The toolkit aims to overcome limitations in memory graphs and graph traversal by providing a clean TypeScript API for developers.
- ▪Lithium offers hierarchical versioned storage on PostgreSQL using ltree.
- ▪It allows for scoped retrieval and has zero runtime dependencies.
- ▪The toolkit includes features like index-backed subtree lookups and built-in versioning.
Opening excerpt (first ~120 words) tap to expand
Lithium Hierarchical versioned storage on PostgreSQL ltree. Scoped retrieval, built-in versioning, zero runtime deps. const lithium = new Lithium(drizzleAdapter(db)); await lithium.clusters.create({ name: "infra" }); await lithium.clusters.create({ name: "database", parentPath: "infra" }); const context = await lithium.getContext({ path: "infra" }); Why? Memory graphs don't scale for tree-structured data. Graph traversal becomes a bottleneck. Vector search gives you "similar to X" when you need "everything under X." PostgreSQL's ltree handles tree queries significantly faster. Index-backed subtree lookups, not traversal. Lithium wraps it in a clean TypeScript API with built-in versioning.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.