Briefing Generator
Dynamically generate contextual follow-up questions to extract the information the panel needs for a high-quality deliberation.
Overview
The Briefing Generator takes a user's decision question and produces 5-7 tailored multiple-choice questions. The answers are compiled into a context string that's injected into the deliberation prompt — giving the panel the constraints, priorities, and domain context it needs.
Note
The questions are AI-generated, not hardcoded. They adapt to the domain and specifics of the user's question. A question about hiring produces different follow-ups than one about technical architecture.
Usage
import { BriefingGenerator } from 'decisionmemos';
import { createDecisionEngine } from 'decisionmemos';
const engine = createDecisionEngine();
const briefing = new BriefingGenerator();
// 1. Generate questions from the user's question
const questions = await briefing.generateQuestions(
"Should we hire a CTO or promote internally?",
engine.getClient('openai') // Uses one model to generate questions
);
// questions = [
// { id: "q1", prompt: "How large is your engineering team?",
// options: [...], allowMultiple: false },
// { id: "q2", prompt: "What's the primary gap you're trying to fill?",
// options: [...], allowMultiple: true },
// ...
// ]
// 2. Collect answers (e.g. from a UI or programmatically)
const answers = {
q1: ["medium"], // 10-50 people
q2: ["strategy", "fundraising"],
q3: ["skip"], // User skipped this question
};
// 3. Compile into context string
const context = briefing.compileContext(questions, answers);
// → "How large is your engineering team? 10-50 people.
// What's the primary gap? Strategy, Fundraising."
// 4. Use the context in the deliberation
// (context is automatically injected into the prompt)Question schema
interface BriefingQuestion {
id: string;
prompt: string; // Short question (< 15 words)
options: Array<{
id: string;
label: string; // Short label (< 10 words)
}>;
allowMultiple: boolean; // Can select multiple options?
}Fallback behaviour
If the AI generation fails (network error, malformed response, etc.), the Briefing Generator falls back to a set of generic questions about timeline, scale, budget, and priorities. These are less tailored but still extract useful context.