Skip to content

An Electron app that uses LangChain so you can chat with your personal documents

Notifications You must be signed in to change notification settings

jonfleming/PersonalAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Personal AI

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.


Screenshot

Screenshot

Technology Stack

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.


Setup

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 Access

OPENAI_API_KEY=<your-openai-api-key>

How to get you OpenAI API Key https://platform.openai.com/account/api-keys

Pinecone API Access

PINECONE_API_KEY=<your-pinecone-api-key>
PINECONE_ENVIRONMENT=<your-pinecone-environment>
PINECONE_INDEX=<your-pineconde-index>

How Vector Similarity Search works

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.

To Run From Source

  1. Clone the repo:
git clone https://github.com/jonfleming/PersonalAI
  1. 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

  1. Run the React frontend:
cd PersonalAI\react-app
npm install
npm start
  1. 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.

About

An Electron app that uses LangChain so you can chat with your personal documents

Resources

Stars

Watchers

Forks

Packages

No packages published