๐Ÿ“ฆ google-gemini / angular-docs-rag-sample

โ˜… 23 stars โ‘‚ 16 forks ๐Ÿ‘ 23 watching โš–๏ธ Apache License 2.0
๐Ÿ“ฅ Clone https://github.com/google-gemini/angular-docs-rag-sample.git
HTTPS git clone https://github.com/google-gemini/angular-docs-rag-sample.git
SSH git clone git@github.com:google-gemini/angular-docs-rag-sample.git
CLI gh repo clone google-gemini/angular-docs-rag-sample
Emma Twersky Emma Twersky Merge pull request #9 from fredsa/patch-readme 69ecab8 1 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .idx
๐Ÿ“ .vscode
๐Ÿ“ functions
๐Ÿ“ src
๐Ÿ“„ .editorconfig
๐Ÿ“„ .firebaserc
๐Ÿ“„ .gitignore
๐Ÿ“„ .prettierrc
๐Ÿ“„ angular.json
๐Ÿ“„ chat-demo.mov
๐Ÿ“„ CONTRIBUTING.md
๐Ÿ“„ firebase.json
๐Ÿ“„ firestore.rules
๐Ÿ“„ LICENSE.md
๐Ÿ“„ package-lock.json
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ tsconfig.app.json
๐Ÿ“„ tsconfig.json
๐Ÿ“„ tsconfig.spec.json
๐Ÿ“„ README.md

Angular Docs RAG Sample

Developer sample written in Angular demonstrating how developers might ingest developer docs and make the content accessible to Gemini via RAG (Retrieval Augmented Generation). The ingested content is accessible in the sample through an Angular chatbot.

Open in IDX

https://github.com/googlestaging/angular-docs-rag-sample/assets/15061394/58e698d4-ced8-44d8-afab-487c6914b704

This project was generated with Angular CLI and uses DocsAgent, to impliment RAG (Retrieval Augmented Generation) with Gemini and create a domain-specific expertise chatbot. This sample uses Googles Semantic Revtriever API and Generative Language APIs as well as an AQA (Attributed Questions and Answer) model with Gemini Pro.

For more information on Angular, visit angular.dev.

Get the demo running locally!

  • Create a personal fork of the project on GitHub, then clone the fork on your local machine.
  • Run npm run i to install the dependencies required to run the server.
  • [IMPORTANT!!] This demo needs a Gemini API to run. Go to Google AI Studio to get an API key then add it to the Firebase Function in functions/.env. This demo simulates how you might store and protect a private Gemini API key in a real world app.
  • [IMPORTANT!!] This demo relies on a CORPUS_NAME from Docs Agent, then authenticates with a service_account_key.json. See DocsAgent Set Up guide to set up your own corpus and authentication. You'll need to replace functions/service_account_key.json with the one provided to you by Google Cloud, and then make sure to march the CORPUS_NAME in functions/ to your uploaded corpus id.
  • Run ng run angular-chatbot:serve to run the server. Since we're using Firebase Functions, you'll need to run our functions and the app in a Firebase Emulator, this command does this automatically!
  • Open a browser tab to http://localhost:4200. The app will automatically reload if you change any of the source files.