Lumos
Auto-generated from andrewnguonly/Lumos by Mutable.ai Auto WikiRevise
Lumos | |
---|---|
GitHub Repository | |
Developer | andrewnguonly |
Written in | TypeScript |
Stars | 1.2k |
Watchers | 7 |
Created | 11/13/2023 |
Last updated | 04/27/2024 |
License | MIT |
Repository | andrewnguonly/Lumos |
Auto Wiki | |
Revision | |
Software Version | 0.0.8Basic |
Generated from | Commit a68ebd |
Generated at | 04/27/2024 |
Lumos is a browser extension that provides a chat-based interface for interacting with AI language models. The core functionality of Lumos is centered around the …/components
and …/scripts
directories, which handle the chat interface and the background processing, respectively.
The …/components
directory contains the key user interface components, such as the ChatBar
, ChatHistory
, CodeBlock
, and PreBlock
. The ChatBar
component manages the core chat functionality, including sending messages, attaching files, and managing the chat history. The ChatHistory
component is responsible for displaying the user's previous conversations and allowing them to load and delete chat history. The CodeBlock
and PreBlock
components provide syntax highlighting for code snippets within the application.
The …/scripts
directory contains the background functionality of Lumos, which is responsible for processing prompts, managing the vector store, handling messages, and streaming responses back to the client. The background.ts
file is the main entry point for this functionality, and it includes features like prompt classification, vector store management, message persistence, and response streaming. The content.ts
file provides utility functions for retrieving the currently selected text and extracting HTML content and image URLs from the page.
Lumos utilizes the EnhancedMemoryVectorStore
class from the …/enhanced_memory
module to efficiently store and retrieve documents in a vector space. This allows the application to provide contextual responses based on the user's chat history and the content of the current web page.
The …/tools
directory contains a Calculator
class, which provides functionality for evaluating arithmetic expressions. This tool can be used within the chat interface to perform calculations.
The …/themes
and …/contexts
directories manage the theming and context-related functionality of the Lumos application, respectively. The ThemeContext
allows the user to toggle between light and dark modes, and the getAppTheme()
function is used to create the appropriate Material-UI theme based on the user's preference.
Overall, Lumos is a powerful browser extension that leverages local language models and vector stores to provide a chat-based interface for interacting with web content. The key design choices focus on modular components, efficient data management, and a seamless user experience.
Chat InterfaceRevise
References: src/components
The ChatBar
component in the …/ChatBar.tsx
file is responsible for the core functionality of the chat interface, including sending messages, attaching files, and managing chat history.
ChatBarRevise
References: src/components/ChatBar.css
, src/components/ChatBar.tsx
The ChatBar
component is the core of the chat interface in the Lumos application. It handles the key functionality of sending messages, attaching files, and managing the chat history.
ChatHistoryRevise
References: src/components/ChatHistory.tsx
The ChatHistory
component in the …/ChatHistory.tsx
file is responsible for displaying the user's chat history and allowing them to load and delete previous conversations.
Code RenderingRevise
References: src/components/CodeBlock.tsx
The CodeBlock
and PreBlock
components in the …/CodeBlock.tsx
file are responsible for rendering code snippets with syntax highlighting.
Configuration and SettingsRevise
References: src/pages
The Configuration and Settings section covers the components responsible for configuring the Lumos application, including the Ollama model, Ollama embedding model, Ollama host, content parser, and various tools.
Ollama ConfigurationRevise
References: src/pages/Options.tsx
The Options.tsx
file in the …/pages
directory provides the user interface for configuring the Ollama model, Ollama embedding model, and Ollama host URL.
Content Parser ConfigurationRevise
References: src/pages/Options.tsx
The Options.tsx
file in the …/pages
directory provides the user interface for configuring the content parser. The component allows the user to edit the JSON configuration for the content parser in a text area.
Vector Store TTLRevise
References: src/pages/Options.tsx
The Vector Store TTL
subsection covers the configuration of the vector store time-to-live (TTL) in the Lumos application. The vector store is used for efficient storage and retrieval of documents in a vector space, and the TTL setting determines how long these documents are stored.
Background FunctionalityRevise
References: src/scripts
The …/background.ts
file is responsible for the core functionality of the Lumos application, including prompt processing and classification, vector store management, message handling, and response streaming.
Vector Store ManagementRevise
References: src/vectorstores
The …/vectorstores
directory contains the implementation of vector stores, which are data structures used for efficient storage and retrieval of documents in a vector space. The main components in this directory are:
ToolsRevise
References: src/tools
The Calculator
class, located in the …/calculator.ts
file, provides a tool for evaluating arithmetic expressions. This class extends the Tool
class from the @langchain/core/tools
module and implements the core functionality for parsing and evaluating expressions.