Obsidian-Copilot
What is Obsidian-Copilot?
Obsidian-Copilot is a project designed to function as a virtual assistant for writing and thinking, integrated with the Obsidian note-taking platform. Imagine having a copilot that helps structure your writing process by retrieving relevant notes and documents to draft sections of your work. This tool leverages a method known as retrieval-augmented generation, providing enhancements in other functionalities as well. For example, it can help you reflect on your past week by reviewing your daily journal entries.
Currently, Obsidian-Copilot benefits users by:
- Assisting in drafting sections based on existing notes.
- Offering weekly reflections using journal entries.
For those interested in the more technical aspects of how it operates, further details can be found in Obsidian-Copilot: A Prototype Assistant for Writing & Thinking.
Getting Started with Obsidian-Copilot
To get started with Obsidian-Copilot, begin by cloning the repository and updating paths to your Obsidian vault and huggingface hub cache.
-
Clone the repository:
git clone https://github.com/eugeneyan/obsidian-copilot.git
-
Update your terminal configuration files (such as
~/.bashrc
or~/.zshrc
) to include theOBSIDIAN_PATH
andTRANSFORMER_CACHE
paths, followed by sourcing it. Ensure your path ends with a trailing slash:export OBSIDIAN_PATH=/path/to/obsidian-vault/ export TRANSFORMER_CACHE=/path/to/.cache/huggingface/hub
-
Create the huggingface hub cache directory if it doesn't exist:
mkdir -p $TRANSFORMER_CACHE
-
Build the OpenSearch and semantic indices by running:
make build # Build the docker image make opensearch # Start the opensearch container make build-artifacts # Build your artifacts
-
Start the retrieval app after stopping the opensearch using CTRL + C:
make run # Start the retrieval app
-
Install the copilot plugin, enable it in the community plugin settings, and update the API key:
make install-plugin
How Does It Work?
The copilot's functionality is designed to enhance productivity and creativity by responding to section headers input by the user. Upon entering a section header, the copilot retrieves relevant documents or snippets from your Obsidian vault using:
- Keyword search: Conducted through OpenSearch.
- Semantic search: Conducted through semantic retrieval.
This retrieved context provides the basis for generating paragraphs for your section. The information utilized is then presented in a new tab for reference.
Contribution and Development
To contribute to the project, you can install pre-commit hooks by executing:
pip install pre-commit && pre-commit install
This should be done at the root of the repository to streamline code contributions and ensure consistency.
Future Developments
The project roadmap includes plans to:
- Add support for using the Anthrophic Claude with a 100k context.
- Evaluate the possibility of sending entire documents rather than just chunks for processing.
Through continuous development, Obsidian-Copilot aims to make the writing and thinking process more seamless and intuitive for its users.