Content Studio¶
The Content Studio lets you upload your existing writing, analyze your style, and generate new content that matches your voice.
Writing Style Analysis¶
Upload content (paste text or import from URL) to build your style profile.
How It Works¶
- Upload content via
POST /api/contentorPOST /api/content/import - Analyze style via
POST /api/content/{id}/analyze - The LLM produces a JSON style profile:
{
"tone": "conversational",
"avg_sentence_length": "medium",
"vocabulary_complexity": "moderate",
"structural_patterns": ["uses headers", "code examples", "bullet points"],
"use_of_examples": true,
"use_of_analogies": true,
"first_person": true,
"typical_intro_style": "Opens with a relatable problem statement",
"typical_conclusion_style": "Summarizes key takeaways with action items"
}
Composite Style Profile¶
When you have multiple uploads, GET /api/content/style-profile merges them into a single composite profile using the LLM. The composite profile is used during content generation.
Content Generation¶
Output Formats¶
| Format | Description |
|---|---|
blog_post |
Comprehensive post with intro, headings, code examples, conclusion |
youtube_script |
Video script with hook, sections, [VISUAL] cues, CTA. 8-12 min target |
linkedin_post |
Under 3000 chars. Hook, short paragraphs, question/CTA, hashtags |
newsletter |
Conversational, scannable with headers and bullets, key takeaways |
Generation Pipeline¶
- Load the target topic and up to 5 related topics from the same group
- Fetch composite style profile (from your uploaded content)
- RAG retrieval — find up to 3 similar pieces of your uploaded content via pgvector cosine similarity
- Build system prompt: format instructions + style profile + RAG examples
- Call LLM with
GENERATIONtask type - Store result in
generated_contenttable
sequenceDiagram
participant User
participant API
participant Gen as ContentGenerationService
participant Style as StyleAnalysisService
participant RAG as UserContentService
participant LLM
User->>API: POST /api/generate {topicId, format}
API->>Gen: generate(topicId, format)
Gen->>Style: getCompositeStyleProfile()
Gen->>RAG: findSimilarContent(topic, 3)
Gen->>LLM: complete(GENERATION, system, user)
LLM-->>Gen: generated text
Gen-->>API: {id, generated_text}
Regeneration with Feedback¶
If the output isn't right, regenerate with feedback:
The system uses the original content + your feedback to produce a revised version. Maximum 5 regenerations per topic+format.
Export¶
Export generated content as Markdown:
RAG Workflow¶
The RAG (Retrieval-Augmented Generation) workflow enhances content generation by referencing your previous writing:
- Embedding — When you upload content, it's embedded as a 1536-dim vector via the LLM embedding model
- Retrieval — During generation, the topic text is embedded and compared to your content library via pgvector cosine similarity
- Context — The top 3 most similar pieces of your content are included in the LLM prompt as style/voice references
Note
RAG requires pgvector to be enabled. Without it, generation still works but without style-matched references.
Content Types¶
When uploading, specify a content type (informational, used for organization):
| Type | Description |
|---|---|
blog_post |
Blog articles |
transcript |
Video/podcast transcripts |
newsletter |
Newsletter issues |