{"id":13588426,"url":"https://github.com/plastic-labs/tutor-gpt","last_synced_at":"2025-06-10T15:10:43.963Z","repository":{"id":171509857,"uuid":"591667477","full_name":"plastic-labs/tutor-gpt","owner":"plastic-labs","description":"AI tutor powered by Theory-of-Mind reasoning","archived":false,"fork":false,"pushed_at":"2025-05-27T14:25:04.000Z","size":6212,"stargazers_count":816,"open_issues_count":14,"forks_count":81,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-27T14:50:23.027Z","etag":null,"topics":["ai","education","hacktoberfest","literacy","machine-learning","o1","prompt-engineering","reasoning","theory-of-mind","tutoring"],"latest_commit_sha":null,"homepage":"https://discord.gg/plasticlabs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plastic-labs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-21T13:30:13.000Z","updated_at":"2025-05-27T13:58:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"dec574a9-f784-443a-99de-2c2d4dcde2a7","html_url":"https://github.com/plastic-labs/tutor-gpt","commit_stats":null,"previous_names":["plastic-labs/tutor-gpt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plastic-labs%2Ftutor-gpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plastic-labs%2Ftutor-gpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plastic-labs%2Ftutor-gpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plastic-labs%2Ftutor-gpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plastic-labs","download_url":"https://codeload.github.com/plastic-labs/tutor-gpt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plastic-labs%2Ftutor-gpt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259098639,"owners_count":22804794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","education","hacktoberfest","literacy","machine-learning","o1","prompt-engineering","reasoning","theory-of-mind","tutoring"],"created_at":"2024-08-01T15:06:42.453Z","updated_at":"2025-06-10T15:10:43.954Z","avatar_url":"https://github.com/plastic-labs.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Prompts","开源项目","A01_文本生成_文本对话","Open Source Projects"],"sub_categories":["其他聊天机器人","大语言对话模型及数据","Other / Chatbots"],"readme":"# Tutor-GPT\n\n![Static Badge](https://img.shields.io/badge/Version-0.7.1-blue)\n[![Discord](https://img.shields.io/discord/1076192451997474938?logo=discord\u0026logoColor=%23ffffff\u0026label=Bloom\u0026labelColor=%235865F2)](https://discord.gg/bloombotai)\n![GitHub License](https://img.shields.io/github/license/plastic-labs/tutor-gpt)\n![GitHub Repo stars](https://img.shields.io/github/stars/plastic-labs/tutor-gpt)\n[![X (formerly Twitter) URL](https://img.shields.io/twitter/url?url=https%3A%2F%2Ftwitter.com%2FBloomBotAI\u0026label=Twitter)](https://twitter.com/BloomBotAI)\n[![arXiv](https://img.shields.io/badge/arXiv-2310.06983-b31b1b.svg)](https://arxiv.org/abs/2310.06983)\n\nTutor-GPT is an LLM powered learning companion developed by [Plastic\nLabs](https://plasticlabs.ai). It dynamically reasons about your learning needs\nand _updates its own prompts_ to best serve you.\n\nWe leaned into theory of mind experiments and it is now more than just a\nliteracy tutor, it’s an expansive learning companion. Read more about how it\nworks [here](https://blog.plasticlabs.ai/blog/Theory-of-Mind-Is-All-You-Need).\n\nTutor-GPT is powered by [Honcho](https://honcho.dev) to build robust user\nrepresentations and create a personalized experience for each user.\n\nThe hosted version of `tutor-gpt` is called [Bloom](https://bloombot.ai) as a\nnod to Benjamin Bloom's Two Sigma Problem.\n\nAlternatively, you can run your own instance of the bot by following the\ninstructions below.\n\n## Project Structure\n\nThe tutor-gpt project is a Next.js application using the app router.\n\n- `app/` - the pages, layouts, and API routes\n- `hooks/` - Custom hooks made for the front end\n- `util/` - Various utility functions and integrations with external services\n- `components/` - this contains a FullStack `Next.js` version of Tutor-GPT\n- `supabase/` - contains SQL scripts necessary for setting up local supabase\n- `scripts/` - Lifecycle scripts that help setup and sync the project\n\nWe use [pnpm](https://pnpm.io/) for dependency management.\n\nThe project also makes use of several third party services\n\n- [Honcho](https://honcho.dev) for identity modeling and personalization\n- [Supabase](https://supabase.com) for user authentication and database\n- [Openrouter](https://openrouter.ai) for LLM integration\n- [PostHog](https://posthog.com) for analytics\n- [Stripe](https://stripe.com) for payments\n\n## Installation\n\nClone the repo and install the necessary Node.js dependencies\n\n```bash\ngit clone https://github.com/plastic-labs/tutor-gpt.git \u0026\u0026 cd tutor-gpt\npnpm install\n```\n\nSet up your [environment variables](#environment-variables) in a `.env.local`\nfile. Then launch the development server.\n\n```bash\npnpm run dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) with your browser to see the result.\n\n## Environment Variables\n\nThis section goes over the various environment variables necessary to run the\nTutor-GPT webui. A `.env.template` file is provided to get started quickly.\n\n**Core**\n\n- `NEXT_PUBLIC_SITE_URL` — The URL that the Next.js application will run from. For\n  local development it will be `http://localhost:3000` by default.\n\n**LLM**\n\n- `AI_API_KEY` — The API key for the inference provider\n- `AI_PROVIDER` — The name of the LLM inference provider\n- `AI_BASE_URL` — An OpenAI compatible API endpoint for LLM inference\n- `MODEL` — The LLM model to use for generating responses.\n\n**Mistral**\n\n- `MISTRAL_API_KEY` — The API key for Mistral OCR\n\n**Honcho**\n\n- `HONCHO_URL` — The URL for the Honcho instance to use\n- `HONCHO_APP_NAME` — The name of the app in Honcho to use\n\n**Supabase**\n\n- `NEXT_PUBLIC_SUPABASE_URL` — The URL for your Supabase project.\n- `NEXT_PUBLIC_SUPABASE_ANON_KEY` — The public API key for your Supabase project.\n- `SUPABASE_SERVICE_ROLE_KEY` — The service key for the Supabase project.\n- `JWT_SECRET` — The secret key to use for signing JWT tokens\n\n**Stripe**\n\n- `NEXT_PUBLIC_STRIPE_ENABLED` — A feature flag to enable or disable stripe. By\n  default, it is `false`\n- `STRIPE_SECRET_KEY` — The stripe secret key\n- `NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY` — The stripe public key\n- `STRIPE_WEBHOOK_SECRET` — The stripe webhook secret\n\nBelow are several optional environment variables to enable error monitoring and\nanalytics.\n\n**Sentry**\n\n- `NEXT_PUBLIC_SENTRY_DSN` — The Sentry DSN\n- `SENTRY_ENVIRONMENT` — The Sentry environment\n- `SENTRY_RELEASE` — The Sentry release\n\n**Posthog**\n\n- `NEXT_PUBLIC_POSTHOG_KEY` — The Posthog project key\n- `NEXT_PUBLIC_POSTHOG_HOST` — The Posthog host\n\n## Supabase\n\n### Setup\n\nThis project uses supabase for managing authentication and keeping track of\nstripe subscriptions. We recommend for testing and local development to use a\nlocal instance of supabase. The supabase-cli is the best way to do this.\n\nFollow the [Supabase Documentation](https://supabase.com/docs/guides/cli/local-development) for more information. The project contains a `supabase/` folder that contains the scaffolding SQL migrations necessary for setting up the necessary tables. Once you have the supabase cli installed you can simply run the below command in the `tutor-gpt` folder and a local instance of Supabase will start up.\n\n\u003e NOTE: Local Supabase relies on docker so ensure docker is also running before running the below command\n\n```bash\nsupabase start\n```\n\nAnother, useful note about doing testing locally with supabase is that there is\nno need to verify an account when it is created so you can create a new account\non the webui and then immediately sign in with it.\n\n### Authentication\n\nThis application uses the new [Supabase SSR](https://supabase.com/docs/guides/auth/server-side) features and the PKCE authentication flow. So there are a\nfew setup steps required before the app works with Supabase.\n\nThe main change is that the email templates for authentication need to be\nmodified to perform the token exchange.\n\nFor usage with a local instance of supabase the appropriate email templates have\nbeen setup in `./supabase/templates`\n\nConfirm Signup\n\n```html\n\u003ch2\u003eConfirm your signup\u003c/h2\u003e\n\n\u003cp\u003eFollow this link to confirm your user:\u003c/p\u003e\n\u003cp\u003e\n  \u003ca href=\"{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}\u0026type=email\"\n    \u003eConfirm your email\u003c/a\n  \u003e\n\u003c/p\u003e\n```\n\nInvite User\n\n```html\n\u003ch2\u003eYou have been invited\u003c/h2\u003e\n\n\u003cp\u003e\n  You have been invited to create a user on {{ .SiteURL }}. Follow this link to\n  accept the invite:\n\u003c/p\u003e\n\u003cp\u003e\n  \u003ca\n    href=\"{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}\u0026type=invite\u0026next=/path-to-your-update-password-page\"\n    \u003eAccept the invite\u003c/a\n  \u003e\n\u003c/p\u003e\n```\n\nMagic Link\n\n```html\n\u003ch2\u003eMagic Link\u003c/h2\u003e\n\n\u003cp\u003eFollow this link to login:\u003c/p\u003e\n\u003cp\u003e\n  \u003ca\n    href=\"{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}\u0026type=magiclink\"\n    \u003eLog In\u003c/a\n  \u003e\n\u003c/p\u003e\n```\n\nChange Email Address\n\n```html\n\u003ch2\u003eConfirm Change of Email\u003c/h2\u003e\n\n\u003cp\u003e\n  Follow this link to confirm the update of your email from {{ .Email }} to {{\n  .NewEmail }}:\n\u003c/p\u003e\n\u003cp\u003e\n  \u003ca\n    href=\"{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}\u0026type=email_change\"\n  \u003e\n    Change Email\n  \u003c/a\u003e\n\u003c/p\u003e\n```\n\nReset Password\n\n```html\n\u003ch2\u003eReset Password\u003c/h2\u003e\n\n\u003cp\u003eFollow this link to reset the password for your user:\u003c/p\u003e\n\u003cp\u003e\n  \u003ca\n    href=\"{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}\u0026type=recovery\u0026next=/auth/reset\"\n    \u003eReset Password\u003c/a\n  \u003e\n\u003c/p\u003e\n```\n\n## Docker\n\nA `Dockerfile` is included for convenience in self hosting an local development.\nto build and run the image run the following commands\n\n```bash\ncd tutor-gpt\ndocker build -t tutor-gpt .\ndocker run --env-file .env.local -p 3000:3000 tutor-gpt\n```\n\n## Contributing\n\nThis project is completely open source and welcomes any and all open source contributions. The workflow for contributing is to make a fork of the repository. You can claim an issue in the issues tab or start a new thread to indicate a feature or bug fix you are working on.\n\nOnce you have finished your contribution make a PR pointed at the `staging` branch and it will be reviewed by a project manager. Feel free to join us in our [discord](http://discord.gg/bloombotai) to discuss your changes or get help.\n\nOnce your changes are accepted and merged into staging they will under go a period of live testing before entering the upstream into `main`\n\n## License\n\nTutor-GPT is licensed under the GPL-3.0 License. Learn more at the [License file](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplastic-labs%2Ftutor-gpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplastic-labs%2Ftutor-gpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplastic-labs%2Ftutor-gpt/lists"}