Skip to content

Effect AI patterns #304

@harrysolovay

Description

@harrysolovay

Effect AI patterns


Effect.gen(function* (topic: string) {
  const ideas = yield* brainstorm(topic);
  const scores = yield* critique(ideas.join("\n"), ["novelty", "feasibility"]);
  const topPick = yield* consensus(scores);
  const plan = yield* plan(`Implement idea ${topPick.index}`);
})

Living idea list:

  • recall(context): a pattern for adding context to the current conversation without completely breaking the flow of the conversation. Should potentially use an LM in a strand to decide the best way to phrase the additional context and then reemphasize the focus of the conversation.
  • explore_alternatives(prompt): From a given prompt or situation, the conversation spawns alternate dialogues – each branch might assume a different approach, parameter, or interpretation – and generates outcomes for each.
  • goal_oriented(target): change the tone of / update the target (maybe some text, maybe a runic?) such that all LM replies are geared towards a clear goal or desired outcome.
  • classify(input): Categorizes / labels the input. Perhaps there are common classifications that make sense (topic, sentiment, urgency, etc.). Perhaps it should be left configurable or open to LM interpretation.
  • brainstorm(topic): generate distinct ideas based on a given topic. Kind of similar to expand. Might be unnecessary.
  • summarize(source): Produces a concise summary of a longer text, transcript, or multi-turn history.
  • critique(content, criteria[]): Evaluates content against an explicit checklist.
  • consensus(child_results[]): Aggregates multiple answers (from debate() or explore_alternatives()) into a single, best-fit resolution.
  • plan(goal): Breaks a high-level goal into ordered steps with owners and success metrics.
  • simulate(role_play_spec): Runs a multi-agent role-play to test scenarios, dialogs, or negotiations.
  • generate_files(tree_desc)
  • edit(file_path, edit_desc)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions