---
title: "Folio: RAG brand content studio | James Littlefield"
description: "On-brand LinkedIn posts, image cards, and documents, written from each brand's own material."
canonical_url: "https://jameslittlefield.net/projects/folio"
meta:
  "og:description": "On-brand LinkedIn posts, image cards, and documents, written from each brand's own material."
  "og:image": "https://jameslittlefield.net/_og/s/o_01bea4b8859636ca.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Folio: RAG brand content studio | James Littlefield"
  "twitter:image": "https://jameslittlefield.net/_og/s/o_01bea4b8859636ca.png"
---

> Index of every page on this site: [llms.txt](https://jameslittlefield.net/llms.txt)

RAG brand content studio

# Folio

On-brand LinkedIn posts, image cards, and documents, written from each brand's own material.

- Live demo view
- Video watch
- Code GitHub

Folio

![Folio generate screen for a demo brand: a brief, a generated image card, the post caption, and the retrieved brand context.](https://jameslittlefield.net/_ipx/f_jpeg&s_1600x1000/images/projects/folio-linkedin-post.jpg)

## 01Overview

Folio writes LinkedIn posts, designed image cards, and branded documents that sound like a specific company. It indexes each brand's voice guides, past posts, and personas, then retrieves the right pieces at generation time so Claude writes on-brand instead of generic copy. Each brand lives in its own workspace, and every generation records which passages it used.

## 02Key features

- One workspace per brand, with its own documents, palette, fonts, and voice
- LinkedIn posts and 1080x1350 image cards, with the preview identical to the exported PNG
- Branded documents exported to Word, PDF, and PowerPoint
- "Learn from an image": upload a logo or brand guide and Claude proposes colors, fonts, and voice for review
- Every generation shows which brand passages it used and their scores

## 03How the AI works

Retrieval decides what Claude sees; two passes decide how it writes.

- Voice and content-pillar passages are always included, plus the top 6 semantic matches, fetched together and deduplicated.
- The copy streams over SSE into the live preview.
- A strict forced tool call then returns the structured fields: headline, body, CTA, hashtag.
- Retrieved brand material is escaped inside a fenced block to resist prompt injection.

## 04Tech stack

<dl>

<dt>AI</dt>
<dd>Claude Sonnet 5.5, Anthropic SDK, OpenAI text-embedding-3-small, LangChain text splitters</dd>

<dt>Frontend</dt>
<dd>React 19, TypeScript, Vite, Tailwind CSS v4, shadcn/ui, Satori and resvg (PNG rendering)</dd>

<dt>Backend</dt>
<dd>Python, FastAPI, Pydantic v2, server-sent events, ReportLab</dd>

<dt>Data</dt>
<dd>MongoDB (Motor), Chroma vector store (one collection per workspace)</dd>

<dt>Infra</dt>
<dd>Docker, GitHub Actions, AWS</dd></dl>

## 05Architecture

Index brand material

1. **Upload**
2. **Parse**
3. **Chunk**800 characters, 120 overlap
4. **Embed**
5. **Store**One vector collection per workspace

Generate

1. **Request**
2. **Retrieve**Pinned plus top 6
3. **Prompt**Brand context fenced
4. **Claude streams copy**
5. **Forced tool call**Structured fields
6. **Render and save**With a retrieval snapshot

## 06Results and evals

| Measure | Result |
| --- | --- |
| Retrieval hit rate at 6 (8 briefs) | Threshold 0.75, scored on a lexical test store |
| Automated tests | About 456 (296 server, 160 client) |
| July security audit | 1 critical, 7 high, all fixed |
| October QA pass | 17 issues, all fixed |

Every generation also saves a snapshot of the passages it used and their scores.

## 07Decisions and lessons

- **No framework.** The pipeline is four steps, so it's written directly on the SDKs instead of LangChain.
- **Vector store.** Chroma and Qdrant over Pinecone, on cost.
- **Hosting.** ECS over Lambda, because cold starts hurt streaming.
- **Pinned pillars.** Content pillars were being crowded out of retrieval, so they are now always included.

## 08Screenshots

Folio

![Folio retrieved context panel listing pinned content-pillar passages.](https://jameslittlefield.net/_ipx/f_jpeg&s_900x562/images/projects/folio-retrieved-context.jpg)

*Retrieved context: which passages were used, pinned or not.*

Folio

![Folio image card generation screen.](https://jameslittlefield.net/_ipx/f_jpeg&s_900x562/images/projects/folio-image-card.jpg)

*Image card generation.*

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://jameslittlefield.net/#website","@type":"WebSite","name":"James Littlefield","url":"https://jameslittlefield.net/","publisher":{"@id":"https://jameslittlefield.net/#identity"}},{"@id":"https://jameslittlefield.net/projects/folio#webpage","@type":"WebPage","description":"On-brand LinkedIn posts, image cards, and documents, written from each brand's own material.","name":"Folio: RAG brand content studio","url":"https://jameslittlefield.net/projects/folio","breadcrumb":{"@id":"https://jameslittlefield.net/projects/folio#breadcrumb"},"isPartOf":{"@id":"https://jameslittlefield.net/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://jameslittlefield.net/projects/folio"]}]},{"@id":"https://jameslittlefield.net/#identity","@type":"Person","jobTitle":"AI Engineer","name":"James Littlefield","url":"https://jameslittlefield.net/","image":{"@id":"https://jameslittlefield.net/#/schema/image/1"},"sameAs":["https://github.com/musicteachj","https://www.linkedin.com/in/james-littlefield-93037713b/"]},{"@id":"https://jameslittlefield.net/projects/folio#creativework","@type":"CreativeWork","description":"On-brand LinkedIn posts, image cards, and documents, written from each brand's own material.","name":"Folio","url":"https://jameslittlefield.net/projects/folio","author":{"@id":"https://jameslittlefield.net/#identity"},"image":{"@id":"https://jameslittlefield.net/#/schema/image/2"}},{"@id":"https://jameslittlefield.net/projects/folio#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"James Littlefield","item":"https://jameslittlefield.net/","position":1},{"@type":"ListItem","name":"Folio","item":"https://jameslittlefield.net/projects/folio","position":2}]},{"@id":"https://jameslittlefield.net/#/schema/image/1","@type":"ImageObject","contentUrl":"https://jameslittlefield.net/images/james.jpg","inLanguage":"en","url":"https://jameslittlefield.net/images/james.jpg"},{"@id":"https://jameslittlefield.net/#/schema/image/2","@type":"ImageObject","contentUrl":"https://jameslittlefield.net/images/projects/folio-linkedin-post.jpg","inLanguage":"en","url":"https://jameslittlefield.net/images/projects/folio-linkedin-post.jpg"}]}
```