new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Cookbook · all subjects

rag/chunking

4 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Chunking strategy for source material

Chunking refers to breaking down source material into smaller pieces before embedding. A simple and common approach is separating written content by sentences or periods. Different chunking approaches suit different use cases, and experimentation is recommended.

Generate text chunks by splitting on periods

Example function to chunk input text: const generateChunks = (input: string): string[] => { return input .trim() .split('.') .filter(i => i !== ''); };

RAG text chunking by sentence splits

Text can be split into chunks by dividing on sentence boundaries (using '.' as delimiter). Each chunk should be trimmed of whitespace and filtered to exclude empty strings.

Chunking strategy for knowledge base setup

Split source content into chunks using double line breaks (paragraphs) as delimiters. Filter to keep only substantial chunks with length greater than 50 characters. Upload chunks to Upstash Search in batches of 100 with metadata including an id, text content, section identifier, and optional title.

Give your agent this brain