Mutable.ai logoAuto Wiki by Mutable.ai
Create your own wiki
AI-generated instantly
Updates automatically
Solo and team plans
Create your own wiki
AI-generated instantly
Updates automatically
Solo and team plans

Lumos

Auto-generated from andrewnguonly/Lumos by Mutable.ai Auto WikiRevise

Lumos
GitHub Repository
Developerandrewnguonly
Written inTypeScript
Stars1.2k
Watchers7
Created11/13/2023
Last updated04/27/2024
LicenseMIT
Repositoryandrewnguonly/Lumos
Auto Wiki
Revision
Software Version0.0.8Basic
Generated fromCommit a68ebd
Generated at04/27/2024
• • •
Architecture Diagram for Lumos
Architecture Diagram for Lumos

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 Interface
Revise

References: src/components

• • •
Architecture Diagram for Chat Interface
Architecture Diagram for Chat Interface

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.

Read more

ChatBar
Revise

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.

Read more

ChatHistory
Revise

• • •
Architecture Diagram for ChatHistory
Architecture Diagram for ChatHistory

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.

Read more

Code Rendering
Revise

• • •
Architecture Diagram for Code Rendering
Architecture Diagram for Code Rendering

The CodeBlock and PreBlock components in the …/CodeBlock.tsx file are responsible for rendering code snippets with syntax highlighting.

Read more

Configuration and Settings
Revise

References: src/pages

• • •
Architecture Diagram for Configuration and Settings
Architecture Diagram for Configuration and Settings

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.

Read more

Ollama Configuration
Revise

• • •
Architecture Diagram for Ollama Configuration
Architecture Diagram for Ollama Configuration

The Options.tsx file in the …/pages directory provides the user interface for configuring the Ollama model, Ollama embedding model, and Ollama host URL.

Read more

Content Parser Configuration
Revise

• • •
Architecture Diagram for Content Parser Configuration
Architecture Diagram for Content Parser Configuration

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.

Read more

Vector Store TTL
Revise

• • •
Architecture Diagram for Vector Store TTL
Architecture Diagram for Vector Store TTL

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.

Read more

Background Functionality
Revise

References: src/scripts

• • •
Architecture Diagram for Background Functionality
Architecture Diagram for Background Functionality

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.

Read more

Vector Store Management
Revise

References: src/vectorstores

• • •
Architecture Diagram for Vector Store Management
Architecture Diagram for Vector Store Management

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:

Read more

Tools
Revise

References: src/tools

• • •
Architecture Diagram for Tools
Architecture Diagram for 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.

Read more