Skip to content

feat: Add haystack quiz agent — multi-source quiz generator - #162

Open
thienphuquach wants to merge 2 commits into
fetchai:mainfrom
thienphuquach:feat/haystack-quiz-agent
Open

feat: Add haystack quiz agent — multi-source quiz generator #162
thienphuquach wants to merge 2 commits into
fetchai:mainfrom
thienphuquach:feat/haystack-quiz-agent

Conversation

@thienphuquach

Copy link
Copy Markdown

Summary

This adds a quiz agent to haystack-agents/ that I built for the Fetch.ai Innovation Lab internship. The core idea: give it any URL or PDF, pay once via Stripe, and get a grounded multiple-choice quiz delivered entirely through ASI:One Interactive Cards , no external app, no file downloads.

A few things worth noting about the implementation:

  • Payment is verified server-side before any quiz logic runs. The Stripe session ID is checked against the Stripe API on CommitPayment, not just trusted from the client message.
  • Wikipedia had to be handled separately direct scraping returns 403, so Wikipedia URLs are routed through the MediaWiki REST API which gives back clean plain text.
  • PDFs from ASI:One arrive as Cloudinary markdown (![file.pdf](url) inside a TextContent block), not as a ResourceContent.
  • No OpenAI embedding key needed — retrieval (Retry Weak Topics, Study Concept) uses BM25 only.
  • brotlicffi is pinned in requirements.txt — Python 3.13 broke the old brotli package; this is the compatible replacement for both aiohttp (mailbox) and requests (URL fetching).

Demo video: https://youtu.be/RmrOGutIjbg

Type of Change

  • New agent example

Checklist

  • I have starred this repository.
  • New community agents are under contributors/<agent-name>/. (This is an Innovation Lab example under haystack-agents/, not a community contribution.)
  • I ran ruff check ..
  • I ran ruff format ..
  • I added/updated README.md.
  • I added .env.example.
  • I added demo image/GIF. (Architecture diagram + YouTube walkthrough linked in README.)
  • I added agent profile link.
  • I updated CHANGELOG.md.
  • I added my agent to the Community Contributors table in root README.md.
  • I verified paths/commands in docs.
  • I understand this PR requires maintainer review before merge.

Notes for Reviewers

.env is gitignored — no secrets in the diff. The only sensitive-looking file is .env.example, which contains only placeholder values and comments.

@gautammanak1
gautammanak1 self-requested a review June 24, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants