Personal AI provides a simple UI that lets you ask questions and use documents on your local computer as context for answering the questions.
It uses LangChain DirectoryLoader to parse, chunk, and generate text embeddings for files in a directory that you specify. The embeddings are store in a Pinecone Vector Database.
Electron - A JavaScript framework for building cross-platform desktop applications leveraging the power of modern web technologies and libraries.
React - A Javascript User Interface library.
Material UI (MUI) - Open Source user interface framework with a broad list of UI components.
LangChain - A framework for developing applications powered by large language models.
You can install Personal AI by downloading the latest setup.exe from the Releases page https://github.com/jonfleming/PersonalAI. Before running Personal AI, you need to set a few environment variables:
OPENAI_API_KEY=<your-openai-api-key>
How to get you OpenAI API Key https://platform.openai.com/account/api-keys
PINECONE_API_KEY=<your-pinecone-api-key>
PINECONE_ENVIRONMENT=<your-pinecone-environment>
PINECONE_INDEX=<your-pineconde-index>
When pages are downloaded from Confluence they are broken up into chuncks and each chunck is turned into a vector using OpenAI's embedding API. These vectors are store in a vector database (Pinecone).
When you type a question into chat, we use the embedding API again to turn your question into a vector. We can then perform a query using MemoryVectorStore.similaritySearch
which will return all of the Confluence chunks that are near your question in vector space.
This context is then added to the question that gets sent as the prompt to ChatGPT.
- Clone the repo:
git clone https://github.com/jonfleming/PersonalAI
- Copy and edit sample.env
copy PersonalAI\electron-app\sample.env PersonalAI\electron-app\.env
Edit
PersonalAI\electron-app\.env
and put in you API keys
- Run the React frontend:
cd PersonalAI\react-app
npm install
npm start
- Run the Electron app (in a separate command prompt):
cd PersonalAI\electron-app
npm install
npm start
This should open your browser to log into Azure.