testxlog

testxlog

Using the Copilot plugin in Obsidian to interact with local data

I. Usage Scenarios#

  • There is a large amount of stored data, and many of them are forgotten
  • Need to have a conversation with the data, such as finding a sentence expressed by a leader several years ago
  • Personal emphasis on privacy, unwilling to feed public language models on the Internet
  • Local computer configuration is decent, with at least 8GB of memory

II. Experimental Ideas#

  • In the Obsidian note-taking software, use the copilot plugin to call the ollama service
  • Use ollama to call large language models, such as llama2-chinese or qwen:4b
  • Implement functions such as Q&A, single-question Q&A, and full-database chat

III. Specific Methods#

  • Install ollama from the official website on the computer
  • Open the terminal or command line mode as an administrator
  • Enter the command ollama run llama2-chinese
  • Wait for the download and installation of the llama2-chinese model to complete
  • Enter /bye to exit ollama
  • Enter the command ollama pull nomic-embed-text
  • Wait for the download and installation of nomic-embed-text to complete
  • Enter /bye to exit ollama
    • Exit the running ollama from the taskbar in the lower right corner of the desktop
    • Exit all ollama.exe processes from the task manager
    • These two steps are crucial
    • Otherwise, an error LangChain error: TypeError: Failed to fetch will occur later
  • Enter set OLLAMA_ORIGINS=app://obsidian.md*
  • Enter ollama serve to start the service
  • Keep the terminal or command line window running
  • Install the copilot plugin in Obsidian
    • Set the default model to ollama(local)
    • Choose the llama2-chinese model for ollama
    • Set the ollama base URL to http://localhost:11434
    • Choose the embedding API as nomic-embed-text
    • Press ctrl+p to bring up the Obsidian command panel
    • Enter copilot and select the desired command
    • The copilot session box will appear on the right sidebar
    • Choose the chat, single-question Q&A, or full-database Q&A mode as needed

IV. Experimental Summary#

  • With a well-configured computer, this may be a good choice
  • Under the premise of emphasizing privacy protection, this will be the best choice
  • Positive aspect: Index dialogue with the entire database
  • Shortcoming: Need to keep the terminal or command line window open at all times
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.