Personal Notes Assistant

Personal Notes Assistant

MCP server that indexes your Obsidian notes into a Milvus vector database and enables querying them via a local or OpenAI LLM, with real-time synchronization.

Category
访问服务器

README

Personal Notes Assistant (Obsidian RAG)

This project provides a Retrieval-Augmented Generation (RAG) server for your Obsidian vault. It indexes your Markdown notes into a Milvus vector database and allows you to query your knowledge base using either a local Large Language Model (LLM) via Ollama or the OpenAI API.

The server automatically watches your vault for changes and keeps the knowledge base synchronized in real-time.

Table of Contents

Features

  • Obsidian Integration: Directly connects to and indexes your Obsidian vault.
  • Real-time Sync: Automatically updates the database when notes are created or modified.
  • Vector Search: Employs sentence-transformers and Milvus to find relevant notes efficiently.
  • Flexible LLM Support: Works with both OpenAI's API and local models through Ollama.
  • Tool-based Interface: Exposes its functionality through a standardized MCP server interface.

Prerequisites

Before you begin, ensure you have the following installed:

  • Python 3.9+
  • uv (for Python package management)
  • Docker and Docker Compose (for running Milvus).
  • An Obsidian vault with your notes.
  • Ollama (optional, only if you plan to use local models).

Setup & Installation

  1. Clone the Repository

    git clone https://github.com/coeusyk/personal-notes-assistant.git
    cd personal-notes-assistant
    
  2. Run Milvus with Docker

    This project includes a docker-compose.yml file to run a Milvus instance.

    docker-compose up -d
    
  3. Install Python Dependencies

    This project uses uv to manage dependencies in a virtual environment.

    # Create a virtual environment
    uv venv
    
    # Activate the virtual environment
    .venv\Scripts\activate # On Linux use `source .venv/bin/activate`
    
    # Install dependencies
    uv pip install -e .
    
  4. A Note on PyTorch with CUDA Support (Optional)

    By default, the command above installs the CPU-only version of PyTorch. If you have a compatible NVIDIA GPU and want to enable CUDA for hardware acceleration, you must manually install the correct version of PyTorch.

    First, uninstall the existing version:

    uv pip uninstall torch
    

    Then, visit the official PyTorch website to find the correct installation command for your specific system and CUDA version. For example, the command might look like this:

    # Example command, check the official website for the correct one for your setup
    uv pip install torch --index-url https://download.pytorch.org/whl/cu121
    
  5. Configure Environment Variables

    Create a .env file by copying the sample file. This is where you will configure the application.

    cp .env.sample .env
    

    Open the new .env file and set the OBSIDIAN_VAULT_PATH. Then, follow the instructions in the next section to configure your chosen LLM provider.

LLM Provider Configuration

You must choose between using Ollama (for local models) or OpenAI.

Option 1: Using Ollama (Default)

To use a local model running on your machine, you first need to install Ollama.

  1. Install Ollama:

    Download and install Ollama for your operating system from the official website.

  2. Download an LLM:

    After installing Ollama, you need to pull a model. Open your terminal and run the following command. For example, to download the mistral:7b-instruct model:

    ollama pull mistral:7b-instruct
    

    Ensure the Ollama application is running. You can find other models in the Ollama library.

  3. Configure your .env file for Ollama:

    # --- Required Settings ---
    OBSIDIAN_VAULT_PATH="C:/Path/To/Your/Vault"
    
    # --- LLM Provider Settings ---
    LLM_PROVIDER=ollama
    
    # --- Ollama Settings ---
    OLLAMA_URL=http://localhost:11434
    LLM_MODEL=mistral:7b-instruct
    
    # --- Milvus Settings (Defaults) ---
    MILVUS_HOST=localhost
    MILVUS_PORT=19530
    

Option 2: Using OpenAI

To use OpenAI's models, you will need an API key.

  1. Configure your .env file for OpenAI:

    # --- Required Settings ---
    OBSIDIAN_VAULT_PATH="C:/Path/To/Your/Vault"
    
    # --- LLM Provider Settings ---
    LLM_PROVIDER=openai
    
    # --- OpenAI Settings ---
    OPENAI_API_KEY=your-openai-api-key-here
    LLM_MODEL=gpt-3.5-turbo
    
    # --- Milvus Settings (Defaults) ---
    MILVUS_HOST=localhost
    MILVUS_PORT=19530
    

Running the Server

With the services running and your .env file configured, start the main application:

python main.py

Keep this process running while you interact with it from clients such as Claude Desktop.

Usage with Claude Desktop

You can drive this server directly from Anthropic’s Claude Desktop via the Model‑Context Protocol (MCP). Claude automatically discovers servers declared in its configuration.

1. Configure Claude Desktop

First, edit (or create) the claude_desktop_config.json file in the appropriate location for your operating system:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Add (or merge) the following JSON configuration. This tells Claude how to find and run the project.

{
  "mcpServers": {
    "obsidian-rag": {
      "command": "uv",
      "args": [
        "--directory",
        "<PATH_TO_PERSONAL_NOTES_ASSISTANT>",
        "run",
        "main.py"
      ],
      "env": {
        "OBSIDIAN_VAULT_PATH": "<PATH_TO_OBSIDIAN_VAULT>",
        "MILVUS_HOST": "localhost",
        "MILVUS_PORT": "19530"
      }
    }
  }
}

You must replace the placeholder values and configure the environment variables:

Placeholder Description
<PATH_TO_PERSONAL_NOTES_ASSISTANT> The absolute path to this project's root directory.
<PATH_TO_OBSIDIAN_VAULT> The absolute path to your Obsidian vault.

Important: Configure your LLM provider within the env block above. The example uses Ollama. If you are using OpenAI, you would set LLM_PROVIDER to openai and add your OPENAI_API_KEY.

2. Restart Claude Desktop

Fully quit and relaunch the Claude Desktop application. When the hammer/tool icon appears in the message composer, the server has been detected and is ready.

3. Chat with Your Notes

Ask Claude questions like, "Search my vault for Vector Databases." Claude will transparently invoke the obsidian-rag tool and include answers sourced directly from your notes in its response.

How It Works

  1. Claude identifies that your query could be answered by one of its available tools.
  2. It calls the search_notes MCP tool exposed by this server.
  3. The server retrieves relevant note chunks from Milvus and synthesizes an answer using your configured LLM.
  4. Claude merges that answer into its final response back to you.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选