BriefGPT is a powerful, locally-run tool for document summarization querying using OpenAI's models. It allows users to retain control over their documents and API keys, ensuring privacy and security. The tool supports both chat-based query responses as well as document summarization based on clustering algorithms and GPT-3 or GPT-4 models. BriefGPT breaks down documents into chunks that are stored in an Faiss index in the "embeddings" folder for later use when loading the same file again. For retrieval of results, similarity search is performed on the index to get top n results which are then re-ranked by a function that strips original queries of stopwords using fuzzy matching to find similarities between query-retrieved results.