🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@mastra/rag

Package Overview
Dependencies
Maintainers
7
Versions
892
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
This package has malicious versions linked to the ongoing "Mastra AI framework compromise" supply chain attack.

Affected versions:

2.2.2
View campaign page

@mastra/rag

alpha
Source
npmnpm
Version
2.4.2-alpha.0
Version published
Weekly downloads
103K
11.95%
Maintainers
7
Weekly downloads
 
Created
Source

@mastra/rag

The Retrieval-Augmented Generation (RAG) module contains document processing and embedding utilities.

Installation

npm install @mastra/rag

Components

Document

The MDocument class represents text content with associated metadata:

import { MDocument } from '@mastra/rag';

const doc = new MDocument({
  text: 'Document content',
  metadata: { source: 'example.txt' },
});

Documentation

Keywords

rag

FAQs

Package last updated on 20 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts