---
title: "Processing embeddings with libSQL, Redpanda Kafka, and Mixedbread"
description: "Embedding generation can be moved out of the request path by publishing successful libSQL writes to a Kafka topic and computing vectors in a background consumer."
url: "https://swe.quest/articles/processing-embeddings-with-libsql-redpanda-kafka-and-mixedbread-f174ef189355e5de"
canonical: "https://turso.tech/blog/processing-embeddings-with-libsql-redpanda-kafka-and-mixedbread"
source: "Turso"
published: "2024-09-19"
difficulty: "medium"
kind: "How-to"
reading_minutes: 9
tags: ["vector-search","sqlite","messaging","event-driven","typescript"]
---

# Processing embeddings with libSQL, Redpanda Kafka, and Mixedbread

A post on [Turso](https://swe.quest/sources/turso.md), published 2024-09-19, 9 min read, How-to. Original: [https://turso.tech/blog/processing-embeddings-with-libsql-redpanda-kafka-and-mixedbread](https://turso.tech/blog/processing-embeddings-with-libsql-redpanda-kafka-and-mixedbread)

## Summary

Embedding generation can be moved out of the request path by publishing successful libSQL writes to a Kafka topic and computing vectors in a background consumer. A libsql-middleware afterExecute hook sends each insert's query and result to a Redpanda Cloud topic via kafkajs. A consumer runs Mixedbread's open-source mxbai-embed-large-v1 locally through transformers.js and writes 1024-dimensional vectors back into an F32\_BLOB column with vector32(). Similar movies are then found with Turso's native vector index and vector\_top\_k. The middleware is presented as a stopgap until Turso ships native change data capture.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Vector search](https://swe.quest/tags/vector-search.md) (Data & databases)
- [SQLite](https://swe.quest/tags/sqlite.md) (Data & databases)
- [Queues & messaging](https://swe.quest/tags/messaging.md) (Backend & APIs)
- [Event-driven architecture](https://swe.quest/tags/event-driven.md) (Backend & APIs)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)

## Prerequisites

- Kafka producers and consumers ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))
- text embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- Node.js/TypeScript ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))

## Keywords

libSQL, Turso, Redpanda, Kafka, Mixedbread, mxbai-embed-large-v1, kafkajs, transformers.js

## Related posts

- [How to Generate & Store OpenAI Vector Embeddings with Turso](https://swe.quest/articles/how-to-generate-store-openai-vector-embeddings-with-turso-1144f075a7bcad32.md): Turso · 2024-07-01 · Medium · 5 min read · Vector search, SQLite, LLMs, JavaScript
  Turso's beta vector support stores OpenAI text-embedding-ada-002 embeddings in a libSQL F32\_BLOB(1536) column, whose size matches the model's 1536 dimensions.
- [Easy Embeddings Indexing Pipelines with Redpanda and Neon](https://swe.quest/articles/easy-embeddings-indexing-pipelines-with-redpanda-and-neon-5e15b71c2d49e429.md): Neon · 2024-09-06 · Medium · 3 min read · Vector search, Data pipelines, PostgreSQL, Queues & messaging, RAG & retrieval
  An embeddings indexing pipeline can be built from configuration alone with Redpanda Connect: it consumes e-commerce invoice messages from a Redpanda Serverless topic over SASL/TLS, builds a text description of each order with Bloblang, computes embeddings locally via Ollama's nomic-embed-text model, and flattens items into separate messages before writing them to Neon Postgres with pgvector for natural-language search.
- [Local RAG with Ollama, Mistral, and Turso](https://swe.quest/articles/local-rag-with-ollama-mistral-and-turso-c9414cc4e6a29ef6.md): Turso · 2025-01-08 · Medium · 8 min read · RAG & retrieval, Vector search, SQLite, Local-first & sync, TypeScript
  A local retrieval-augmented generation pipeline can be built in TypeScript using Ollama's Mistral model for both embeddings and generation, with libSQL storing documents and 4096-dimension F32\_BLOB vectors in a single SQLite file indexed via libsql\_vector\_idx.
- [Personal Knowledge Graphs in AI RAG-powered Applications with libSQL](https://swe.quest/articles/personal-knowledge-graphs-in-ai-rag-powered-applications-with-libsql-0896de56d7bc65a9.md): Turso · 2024-09-30 · Medium · 6 min read · Vector search, SQLite, RAG & retrieval, Local-first & sync, Mobile
  Kin, a local-first mobile personal AI, stores its personal knowledge graph in libSQL so that relational data, graph edges and vector embeddings live in one embeddable single-file database instead of syncing a separate store like faiss.
- [Automatic Embeddings in Postgres](https://swe.quest/articles/automatic-embeddings-in-postgres-41612b12257af4ee.md): Supabase · 2025-04-01 · Medium · 6 min read · PostgreSQL, Vector search, RAG & retrieval, Queues & messaging
  Supabase moves embedding generation coordination into Postgres.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
