examples/basics/rag/insert-embedding-in-libsql/README.md
This example demonstrates how to store embeddings in LibSQL using Mastra. It shows how to:
Clone the repository and navigate to the project directory:
git clone https://github.com/mastra-ai/mastra
cd examples/basics/rag/insert-embedding-in-libsql
Copy the environment variables file and add your OpenAI API key:
cp .env.example .env
Then edit .env and add your OpenAI API key and LibSQL database URL:
OPENAI_API_KEY=sk-your-api-key-here
DATABASE_URL=libsql://your-database-url
DATABASE_AUTH_TOKEN=your-database-auth-token (optional)
Install dependencies:
pnpm install
Run the example:
pnpm start
The example:
The stored embeddings can then be used for similarity search and retrieval in your RAG applications.