Personal-RAG CLI 0.1.5 (Windows x64)
====================================

Portable build of the Personal-RAG command-line client. No installer and no
admin rights: unzip and run.

Contents
  personal-rag.exe   the CLI and the MCP server
  README.txt         this file

The embedding model is NOT inside the exe (about 91 MB). It is looked up in
this order:

  1. <data folder>\models
  2. models\ or resources\models\ next to personal-rag.exe
  3. the desktop app's install folder:
     %LOCALAPPDATA%\Programs\Personal-RAG\resources\models
     %LOCALAPPDATA%\Personal-RAG\resources\models

If the desktop app is already installed, nothing else is needed: the CLI finds
its bundled model automatically. If all three are missing, copy the desktop
app's resources\models folder next to personal-rag.exe and rename it to
models\.

Install
  1. Unzip this archive over your existing folder, for example
     C:\Tools\personal-rag\
     Keep the existing models\ folder.
  2. Open a new terminal and run:
       personal-rag paths --json
       personal-rag doctor

  The commands below use "personal-rag" for brevity. If
  C:\Tools\personal-rag is not on your PATH, run the full path instead,
  for example:
       C:\Tools\personal-rag\personal-rag.exe paths --json
     paths prints the vault / data / config locations. doctor checks the
     database, the derived indexes and the embedding model.

Use it with opencode / Claude Desktop / Cursor / VS Code
  stdio, recommended while the desktop app is running:
       personal-rag.exe mcp --read-only

  opencode.json, under "mcp":
       "personal-rag": {
         "type": "local",
         "command": ["C:\\Tools\\personal-rag\\personal-rag.exe", "mcp", "--read-only"],
         "enabled": true
       }

  Claude Desktop / Cursor:
       {
         "mcpServers": {
           "personal-rag": {
             "command": "C:\\Tools\\personal-rag\\personal-rag.exe",
             "args": ["mcp", "--read-only"]
           }
         }
       }

  VS Code (Copilot) uses "servers" instead of "mcpServers", with
  "type": "stdio".

  The desktop executable can serve MCP too:
       personal-rag-desktop.exe mcp --read-only

  Check the connection with:
       opencode mcp list

Asking questions
       personal-rag ask "..."                  answer with sources
       personal-rag ask "..." --lang en|zh     force the answer language
       personal-rag retrieve "..."             retrieval only, no LLM
       personal-rag ask "..." --json           machine-readable output

API key
  The key is read from Windows Credential Manager (personal-rag:llm_api_key).
  Both UTF-8 and UTF-16LE values are accepted (cmdkey writes UTF-16LE).
  If the stored value is malformed, 0.1.5 stops before sending the request and
  prints an English, actionable error, for example:

       Config error: could not read the API key from Credential Manager: ...

  Fix it by re-saving the key in the desktop app (Settings -> Model), or delete
  personal-rag:llm_api_key in Windows Credential Manager and enter it again.
  An unreadable key no longer makes paths / stats / ingest fail; only ask fails,
  with exit code 1.

Troubleshooting
  - "local embedding model is missing": see the model lookup order above.
  - "Received a response for an unknown message ID ... serverInfo name
    personal-rag-local": that response did not come from this server. This
    server identifies itself as "personal-rag". Remove the temporary server
    entry from your client configuration and keep only personal-rag.
  - "builder error" should never appear in 0.1.5. If it does, run
    personal-rag doctor and send the output.
  - The binary is unsigned; SmartScreen may warn on first run
    ("More info" -> "Run anyway").

Version
  personal-rag 0.1.5
