Add ScholarAI: Cloudflare Python Worker AI research assistant#1
Open
Add ScholarAI: Cloudflare Python Worker AI research assistant#1
Conversation
Co-authored-by: A1L13N <193832434+A1L13N@users.noreply.github.com>
Co-authored-by: A1L13N <193832434+A1L13N@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add AI-powered research assistant using Cloudflare AI
Add ScholarAI: Cloudflare Python Worker AI research assistant
Mar 8, 2026
Contributor
|
@copilot user wrangler.toml and dont use fastapi or any plugins |
Co-authored-by: A1L13N <193832434+A1L13N@users.noreply.github.com>
Author
Done in commit
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a full AI-powered academic research assistant as a Cloudflare Python Worker backed by Workers AI (
@cf/meta/llama-3.1-8b-instruct). Covers paper discovery, summarization, citation exploration, Q&A, knowledge organization, trend analysis, and literature review generation.Structure
src/entry.py— Plain Python using onlyworkers.Response+WorkerEntrypoint. Manual URL routing viaurllib.parse. Business logic is split into pure async handler functions (handle_discover,handle_summarize, etc.) that return(dict, int)tuples. No third-party frameworks.wrangler.toml— Workers config in TOML format withpython_workerscompatibility flag and[ai]binding.pyproject.toml/package.json— Python deps (webtypy) and Wrangler CLI scripts (npm run dev/npm run deploy).conftest.py— MinimalworkersSDK stub (stubs bothResponseandWorkerEntrypoint) enabling pytest to importsrc/entry.pyoutside the Cloudflare runtime.tests/test_entry.py— 27 async pytest tests calling handler functions directly with a mockedenv.AIbinding (no HTTP stack or TestClient required).Endpoints
GET /POST /api/discoverPOST /api/summarizePOST /api/citationsPOST /api/qaPOST /api/organizePOST /api/trendsPOST /api/reviewRequest/response shape (example)
Architecture
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.