# Flash Cards from PDF

Turns a PDF into study flash cards, with optional AI-generated images per concept.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).



<DocsBaseSwitcher base="langgraph" agent="flashcards-pdf" />

<AgentPreview
  agent="flashcards-pdf"
  framework="langgraph"
  inputFields="[
  {
    name: &#x22;url&#x22;,
    label: &#x22;PDF URL&#x22;,
    placeholder: &#x22;https://example.com/biology-chapter.pdf&#x22;,
    type: &#x22;text&#x22;,
  },
]"
/>

## Summary [#summary]

The **Flash Cards from PDF Agent** turns a document into ready-to-study flash
cards. It extracts the text, identifies the concepts worth memorizing, and writes
concise front/back pairs — and on request, generates an illustrative image for
each card. Reach for it to build study decks from textbooks, slides, or notes.

## Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @agentcn/langgraph/flashcards-pdf
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Install the following dependencies:
      </Step>

      ```bash
      npm install @dawn-ai/sdk pdf-parse
      ```

      <Step>
        Copy and paste the following agent route files into your project.
      </Step>

      <ComponentSource src="registry/langgraph/flashcards-pdf/index.ts" title="index.ts" />

      <ComponentSource src="registry/langgraph/flashcards-pdf/instructions.md" title="instructions.md" />

      <ComponentSource src="registry/langgraph/flashcards-pdf/tools/generate_image.ts" title="tools/generate_image.ts" />

      <ComponentSource src="registry/langgraph/flashcards-pdf/tools/parse_pdf.ts" title="tools/parse_pdf.ts" />

      <Step>
        Run `dawn check` after copying so route and tool metadata are regenerated.
        `dawn dev`, `dawn build`, and `dawn verify` also run the same discovery path.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

## Composition [#composition]

```text
├── index.ts
├── instructions.md
├── tools/generate_image.ts
├── tools/parse_pdf.ts
```

## Customization [#customization]

* Edit `index.ts` to change the model, description, or system prompt.
* Add route-local tools under `tools/`; tool input and output types are inferred from TypeScript.
* Run `dawn verify` before deploying generated LangGraph artifacts.
