๐Ÿšง ย  This page is coming soon
โœ“ ย  Copied to clipboard
NEWv0.4.2 is live โ€” The latest performance and feature updates are now available.
Menu
โšก
@manasdb/core

core

STABLEv0.4.2

Drop-in semantic memory with local embeddings, hybrid retrieval, Redis caching, PII protection, and full cost telemetry โ€” all in a single import.

$npm install @manasdb/coreโŽ˜
๐Ÿ“– Read Documentation โ†—
29ร—
Faster repeated queries (Redis)
โˆ’50%
API cost via dedup
+9.7%
Recall accuracy vs raw stack
2
Storage providers
What's inside

Features

๐Ÿ”€
Hybrid Retrieval
Dense ANN fused with sparse keyword search via Reciprocal Rank Fusion, diversified with Maximal Marginal Relevance.
RRF + MMR
โšก
Two-Tier Redis Cache
Tier 1 shared Redis + Tier 2 in-memory LRU. Both short-circuit the DB when cosine similarity โ‰ฅ 0.95.
29x faster
๐ŸŒฒ
Tree Reasoning
Hierarchical chunk mapping (Document โ†’ Section โ†’ Leaf). Returns structured answers from the highest-scoring subtree.
reasoningRecall()
๐Ÿ›ก๏ธ
PII Shield
Regex-based redaction of emails, phone numbers, SSNs, and custom patterns before any text hits your database.
Before storage
๐Ÿ“Š
Cost Telemetry
Tracks tokens, API cost, and latency savings in _manas_telemetry on your own DB. Never leaves your server.
npx manas stats
๐Ÿ”
Trace Debugging
Every recall() emits full pipeline audit: cache status, PII tokens scrubbed, candidate counts, final score.
_trace on every call
๐Ÿ”—
Polyglot Broadcasting
Write once, sync to MongoDB and PostgreSQL simultaneously โ€” great for migration, replication, or benchmarking.
absorb() โ†’ all
๐Ÿ”Œ
Custom Drivers
Plug any air-gapped or corporate embedding model. ManasDB becomes your standard interface over the stack.
source: 'custom'
Examples

Quick start

index.js
import { ManasDB } from '@manasdb/core';
const memory = new ManasDB({
uri: process.env.MONGODB_URI,
modelConfig: { source: 'transformers' },
});
await memory.init();
await memory.absorb('ManasDB Core is the Node.js memory layer for AI.');
const results = await memory.recall('What is ManasDB Core?');
console.log(results[0].metadata.matchedChunk);
API Reference

Methods

absorb(text, options?)โ†’ Promise<AbsorbResult>+
recall(query, options?)โ†’ Promise<RecallResult[]>+
reasoningRecall(query, options?)โ†’ Promise<TreeRecallResult>+
init()โ†’ Promise<void>+
Compatibility

Requirements

Node.jsโ‰ฅ 18.0
MongoDBAtlas (Vector Search)
PostgreSQLpgvector
LicenseApache 2.0 + Commons Clause