Apache License 2.0

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

MineContext 深度技术分析

项目背景与痛点

随着人工智能与大数据技术的发展,智能化上下文理解与交互成为新一代人机交互的焦点。而 volcengine/MineContext 正是瞄准了这一市场需求,旨在成为用户手中的智能助手。它的设计初衷是解决用户在使用复杂上下文系统时遇到的信息过载和响应延迟问题。在数据量日益庞大、用户需求细化的今天,一款能够主动感知用户需求并提供及时响应的 AI 伙伴无疑是一种迫切的需求。

核心技术揭秘

MineContext 的核心在于其上下文感知与主动响应机制。其背后采用了一系列前沿技术,包括但不限于自然语言处理(NLP)、机器学习和深度学习算法。数据流处理框架与实时计算技术的结合,保障了数据收集、解析与分发的高效性,增强了系统的响应速度与准确性。

其核心技术架构如下:

graph TD A[用户请求] --> B{"参数校验"} B -->|"通过"| C[执行业务] C --> D[上下文解析] D --> E{"智能决策"} E -->|"路由业务"| F[后端服务] E -->|"生成响应"| G[前端展示] B -->|"失败"| H[返回错误]

从上图可以看出,MineContext 首先通过参数校验过滤非法请求,确保安全稳定运行。随后,系统解析用户的上下文信息,根据智能决策模块的判断调用合适的后端服务,完成任务处理,最后将结果展现给用户。整个过程高效且灵活,适应了多变的用户需求。

功能亮点与差异

与市面上其他智能助手相比,MineContext 在以下几个方面彰显了其独特优势:

  • 智能响应:通过主动识别用户需求并提前准备好响应方案,大幅提升了用户体验。
  • 高效数据处理:采用分布式数据处理框架,确保在高负载情况下依然保持快速响应,这得益于其成熟的实时计算技术。
  • 上下文感知:细致入微的上下文理解能力让用户交互更直观自然,减少了错误理解和无效交互。

应用场景与落地建议

MineContext 适合于各种领域,如在线客服、智能助手、智能家居等场景。部署时需注意其依赖关系和环境配置,确保有足够的计算资源以支撑数据流处理和智能计算。对于高并发场景,建议通过负载均衡技术来分担压力,确保服务的稳定性和可用性。

综合评价

MineContext 在智能助手领域展现出了不俗的表现,但同时也存在一些潜在的挑战,比如前端展示的一致性和大规模部署的资源需求。总体而言,作为一个上下文感知的 AI 设计,MineContext 完全胜任其使命,对于希望在智能化环境中提升用户体验的开发者来说,值得深度考量和部署。

关于

GitHub 原始描述(英文)

MineContext is your proactive context-aware AI partner(Context-Engineering+ChatGPT Pulse)

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

Batchfile
CSS
HTML
JavaScript
Less
NSIS
Python
Shell
TypeScript

Release

README

MineContext

MineContext: Create with Context, Clarity from Chaos

An open-source, proactive context-aware AI partner, dedicated to bringing clarity and efficiency to your work, study and creation.

中文 / English

Community Best Practice · Report Issues · Feedback


volcengine%2FMineContext | Trendshift

👋 Join our WeChat / Lark / Red Note Group

🌍 Join our Discord Group

🖥️ Download for Mac · 💻 Download for Windows

Table of Contents


🔗 Related Project: Check out OpenViking - An open-source Context Database designed for AI Agents. OpenViking unifies Memories, Resources, and Skills through a “file system paradigm”, providing the infrastructure layer for sophisticated context management.


👋🏻 What is MineContext

MineContext is a proactive context-aware AI partner. By utilizing screenshots and content comprehension (with future support for multi-source multimodal information including documents, images, videos, code, and external application data), it can see and understand the user’s digital world context. Based on an underlying contextual engineering framework, it actively delivers high-quality information such as insights, daily/weekly summaries, to-do lists, and activity records.

feature.gif

🚀 Key Features

MineContext focuses on four key features: effortless collection, intelligent resurfacing, proactive delivery, and a context engineering architecture.

  1. 📥 Effortless Collection Capable of gathering and processing massive amounts of context. Designed storage management enables extensive collection without adding mental burden.
  2. 🚀 Proactive Delivery Delivers key information and insights proactively in daily use. It extracts summarized content from your context—such as daily/weekly summaries, tips, and todos—and pushes them directly to your homepage.
  3. 💡 Intelligent Resurfacing Surfaces relevant and useful context intelligently during creation. Ensures assisted creativity without overwhelming you with information.
  4. 🎯 Context Engineering Architecture Supports the complete lifecycle of multimodal, multi-source data—from capture, processing, and storage to management, retrieval, and consumption—enabling the generation of six types of intelligent context.

🔏 Privacy Protection

Local-First

MineContext places a high priority on user privacy. By default, all data is stored locally in the following path to ensure your privacy and security.

~/Library/Application Support/MineContext/Data

Local AI model

In addition, we support custom model services based on the OpenAI API protocol. You can use fully local models in MineContext, ensuring that any data does not leave your local environment.

🏁 Quick Start

1. Installation

Click Github Latest Release to Download

Download APP

Note: Starting from v0.1.5, MineContext supports Apple notarization, so you no longer need to disable the quarantine attribute. If you’re using an older version, please refer to the previous documentation for instructions.

2. Enter Your API Key

After the application launches, please follow the prompts to enter your API key. (Note: On the first run, the application needs to install the backend environment, which may take about two minutes).

We currently support services from Doubao, OpenAI, and custom models. This includes any local models or third-party model services that are compatible with the OpenAI API format.

We recommend using LMStudio to run local models. It provides a simple interface and powerful features to help you quickly deploy and manage them.

Considering both cost and performance, we recommend using the Doubao model. The Doubao API Key can be generated in the API Management Interface.

After obtaining the Doubao API Key, you need to activate two models in the Model Activation Management Interface: the Visual Language Model and the Embedding Model.

  • Visual Language Model: Doubao-Seed-1.6-flash doubao-vlm-model

  • Embedding Model: Doubao-embedding-vision doubao-emb-model

The following is the filling process after obtaining the API Key:

Enter API Key

3. Start Recording

Enter [Screen Monitor] to enable the system permissions for screen sharing. After completing the setup, you need to restart the application for the changes to take effect. Enable-Permissions

After restarting the application, please first set your screen sharing area in [Settings], then click [Start Recording] to begin taking screenshots. Screen-Settings

4. Forget it

After starting the recording, your context will gradually be collected. It will take some time to generate value. So, forget about it and focus on other tasks with peace of mind. MineContext will generate to-dos, prompts, summaries, and activities for you in the background. Of course, you can also engage in proactive Q&A through [Chat with AI].

5. Backend Debugging

MineContext supports backend debugging, which can be accessed at http://localhost:1733.

1.View Token Consumption and Usage 后台调试1

2.Configure Interval for Automated Tasks 后台调试2

3.Adjust System Prompt for Automated Tasks 后台调试3

🎃 Contribution Guide

🎨 Frontend Architecture

The MineContext frontend is a cross-platform desktop application built with Electron, React, and TypeScript, providing a modular, maintainable, and high-performance foundation for desktop development.

Core Tech Stack

Technology Description
Electron Allows for the development of cross-platform desktop applications using web technologies.
React A component-based UI library for building dynamic user interfaces.
TypeScript Provides static type checking to enhance code maintainability.
Vite A modern frontend build tool optimized for Electron.
Tailwind CSS A utility-first CSS framework for rapid and consistent UI styling.
pnpm A fast and efficient package manager suitable for monorepo projects.

Core Architecture

The project follows a standard Electron architectural design, clearly separating the code for the main process, preload scripts, and renderer process to ensure security and maintainability.

frontend/
├── src/
│ ├── main/     # Electron main process (window management, lifecycle, IPC)
│ ├── preload/  # Preload script, securely bridging Node APIs and the renderer process
│ └── renderer/ # React frontend interface (renderer process)
│
├── packages/
│ └── shared/   # Common utilities, IPC channels, logging, and constant definitions
│
├── build/      # Build resources (icons, platform configurations)
├── dist/       # Build artifacts generated by electron-builder
├── externals/  # External dependencies (Python scripts, binaries, etc.)
├── resources/  # Static assets (icons, templates, images)
└── scripts/    # Development and build helper scripts
  1. Main Process (src/main/) is responsible for:

    • Managing application windows
    • Handling lifecycle events (startup, quit, activate)
    • Establishing secure IPC communication
    • Integrating with backend services (Python and system APIs)
  2. Preload Script (src/preload/) is responsible for:

    • Securely exposing Node.js APIs to the renderer process
    • Handling IPC communication with the main process
    • Implementing cross-process resource access
  3. Renderer Process (src/renderer/) is responsible for:

    • Implementing the user interface with React
    • Managing global state with Jotai and Redux
    • Utilizing an efficient styling system based on Tailwind CSS
    • Implementing dynamic loading and performance optimization mechanisms
  4. Build and Packaging are responsible for:

    • electron-vite.config.ts — Configures the build logic for both the main and renderer processes (aliases, plugins, etc.).
    • electron-builder.yml — Defines packaging and distribution configurations for Windows, macOS, and Linux.

💻 Frontend Usage

Build Backend

Before starting frontend development, you need to build the backend first:

uv sync
source .venv/bin/activate
./build.sh

Install Dependencies

Due to package version issues, using a domestic PyPI mirror is not currently supported. Please run the following command to ensure you are using the original PyPI source:

pip config unset global.index-url
cd frontend
pnpm install

Development and Debugging

During local development, it is normal for the screen capture area selection to be slow. Please wait, as this issue does not exist in the packaged application.

pnpm dev

Application Packaging

To build APP for macOS:

pnpm build:mac
# Data Path
# ~/Library/Application\ Support/MineContext

The executable files generated by the packaging process will be stored in the MineContext/frontend/dist directory.

🏗️ Backend Architecture

MineContext adopts a modular, layered architecture design with clear separation of concerns and well-defined responsibilities for each component.

Core Architecture Components

opencontext/
├── server/             # Web server and API layer
├── managers/           # Business logic managers
├── context_capture/    # Context acquisition modules
├── context_processing/ # Context processing pipeline
├── context_consumption/# Context consumption and generation
├── storage/            # Multi-backend storage layer
├── llm/               # LLM integration layer
├── tools/             # Tool system
└── monitoring/        # System monitoring

Layer Responsibilities

  1. Server Layer (server/)

    • FastAPI-based RESTful API
    • WebSocket support for real-time communication
    • Static file serving and template rendering
  2. Manager Layer (managers/)

    • CaptureManager: Manages all context capture sources
    • ProcessorManager: Coordinates context processing pipeline
    • ConsumptionManager: Handles context consumption and generation
    • EventManager: Event-driven system coordination
  3. Context Capture Layer (context_capture/)

    • Screenshot monitoring
    • Document monitoring
    • Extensible capture interface for future sources
  4. Processing Layer (context_processing/)

    • Document chunking strategies
    • Entity extraction and normalization
    • Context merging and deduplication
    • Multi-modal content processing (text, images)
  5. Storage Layer (storage/)

    • Multi-backend support (SQLite, ChromaDB)
    • Vector storage for similarity search
    • Unified storage interface
  6. LLM Integration (llm/)

    • Support for multiple LLM providers (OpenAI, Doubao)
    • VLM (Vision-Language Model) integration
    • Embedding generation services

🚀 Backend Usage

Installation

We recommend using uv for fast and reliable package management:

# Clone repository
git clone https://github.com/volcengine/MineContext.git
cd MineContext

# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Sync dependencies (automatically creates virtual environment)
uv sync

Configuration

  1. Basic Configuration (config/config.yaml):
server:
  host: 127.0.0.1
  port: 8765
  debug: false

embedding_model:
  provider: doubao # options: openai, doubao
  api_key: your-api-key
  model: doubao-embedding-vision-250615

vlm_model:
  provider: doubao # options: openai, doubao
  api_key: your-api-key
  model: doubao-seed-1-6-flash-250828

capture:
  enabled: true
  screenshot:
    enabled: true # enable screenshot capture
    capture_interval: 5 # capture interval in seconds
  1. Prompt Templates (config/prompts_*.yaml):
    • prompts_en.yaml: English prompt templates
    • prompts_zh.yaml: Chinese prompt templates

Running the Server

# Start with default configuration
uv run opencontext start

# Start with custom config
uv run opencontext start --config /path/to/config.yaml

# Start with custom port (useful for avoiding conflicts)
uv run opencontext start --port 1733

Available Options:

  • --config: Path to configuration file
  • --host: Host address (default: from config or localhost)
  • --port: Port number (default: from config or 1733)

Priority: Command-line arguments > Config file > Default values

Alternatively, you can activate the virtual environment manually:

source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -e .
opencontext start --port 1733

💎 The Philosophy Behind the Name

The naming of MineContext also reflects the team’s ingenuity. It signifies both “my context” and “mining context.” It draws inspiration from the core philosophy of Minecraft—openness, creativity, and exploration.

If vast amounts of context are like scattered “blocks,” then MineContext provides a “world” where you can freely build, combine, and create. Users can reimagine and create new content based on the collected massive context and generate high-quality information.

🎯 Target User

Target User Category Specific Roles/Identities Core Needs/Pain Points
Knowledge Workers Researchers, Analysts Navigating vast amounts of information, improving information processing and analysis efficiency
Content Creators Writers, Bloggers Craving endless inspiration, optimizing content creation workflows
Lifelong Learners Students, Researchers Building systematic knowledge systems, efficiently managing and connecting learning materials
Project Managers Product Managers, Project Managers Integrating multi-source information and data, ensuring project alignment and decision-making efficiency

🔌 Context-Source

We will prioritize the expansion of Context Sources according to the following plan, and we warmly welcome everyone to actively contribute code to our efforts.

  • P0: Digital life and public information loop (PC screen capture and link upload)
  • P1: Personal text context loop (file upload, file tracking)
  • P2: AI and common office context loop (MCP, meeting notes)
  • P3: High-quality information acquisition loop (DeepResearch and RSS)
  • P4: Personal deep context loop (WeChat, QQ chat data acquisition, mobile screenshots)
  • P5: Physical world context loop (smart wearable synchronization, smart glasses synchronization)
Context Capture Capability Context Source Priority Completion Status
Screen Screenshot User PC Information P0 ✅
Note Editing Application Internal Creation Information P0 ✅
Link Upload Internet Information P0
File Upload Structured Documents P1
File Upload Unstructured Documents P1
File Upload Images P1
File Upload Audio P4
File Upload Video P4
File Upload Code P4
Browser Extension AI Conversation Records P2
Browser Extension Refined Internet Information P5
Meeting Records Meeting Information P2
RSS Consultation Information P3
Deep Research High-Quality Research Analysis P3
Application MCP/API Payment Records P4
Application MCP/API Research Papers P3
Application MCP/API News P4
Application MCP/API Emails P4
Application MCP/API Notion P2
Application MCP/API Obsidian P2
Application MCP/API Slack P4
Application MCP/API Jira P4
Application MCP/API Figma P2
Application MCP/API Linear P4
Application MCP/API Todoist P4
Memory Bank Migration Import User Memory P4
WeChat Data Capture WeChat Chat History P4
QQ Data Capture QQ Chat History P4
Mobile Screenshot Monitor User Mobile End Information P4
Smart Glasses Data Sync Physical World Interaction Records P5
Smart Bracelet Data Sync Physiological Data P5

🆚 Comparison with Familiar Application

MineContext vs ChatGPT Pulse

  • 🖥️ Comprehensive Digital Context: MineContext captures your entire digital workflow by reading from screen screenshots, providing a rich, visual context of your daily activities and applications. ChatGPT Pulse, in contrast, is limited to the context of a single text-based conversation.
  • 🔒 Local-First Data & Privacy: Your data is processed and stored entirely on your local device, ensuring complete privacy and security without relying on cloud servers. ChatGPT Pulse requires data to be sent to and stored on OpenAI’s servers.
  • 🚀 Proactive & Diverse Insights: MineContext delivers a wider variety of intelligent, auto-generated content—including daily summaries, actionable todos, and activity reports—not just simple tips. ChatGPT Pulse primarily offers reactive assistance within the chat interface.
  • 🔧 Open Source & Customizable: As an open-source project, MineContext allows developers to freely inspect, modify, and build upon the codebase for complete customization. ChatGPT Pulse is a closed, proprietary product with no option for modification.
  • 💰 Cost-Effective API Usage: MineContext avoids the need for a costly $200/month Pro subscription by allowing you to use your own API key, giving you full control over your spending. ChatGPT Pulse’s advanced features are locked behind its expensive premium tier.

MineContext vs Dayflow

  • 💡 Richer, Proactive Insights: MineContext delivers a more diverse range of automated, intelligent content—including concise summaries, actionable todos, and contextual tips—going beyond basic activity tracking. DayFlow primarily focuses on logging user activity.
  • 🧠 Context-Aware Q&A & Creation: MineContext enables you to ask questions and generate new content based on your captured context, unlocking wider application scenarios like content drafting and project planning. DayFlow is limited to passive activity recording and review.
  • ✨ Superior Activity Generation & Experience: MineContext produces activity records with greater clarity and detail, featuring a more intuitive and interactive dashboard for a seamless user experience. DayFlow’s activity logs are more basic with limited interactivity.

👥 Community

Community and Support

  • GitHub Issues: Errors and issues encountered while using MineContext.
  • Email Support: Feedback and questions about using MineContext.
  • WeChat Group: Discuss SwanLab usage and share the latest AI technologies.

Star History

Star History Chart

📃 License

This repository is licensed under the Apache 2.0 License.

评论

暂无评论