obsidian-copilot
obsidian-copilot copied to clipboard
Custom prompt should support Obsidian Sync
First of all, your plugin is a life saver! Great work.
I am a big user of custom prompts, however it does not seem to sync across my devices via Obsidian Sync.
I looked at the implementation and it seems to use PouchDB, which I assume does not write to my vault and thus will not be synced.
Do you have plans to support this?
This would be nice and probably not too difficult to implement. Similarly if embeddings could be saved to a local file and synced then it could help cut costs of duplicating embeddings on different devices.
Indeed these are great suggestions. Probably data.json can be used for syncing? Copilot could check it at load time and update the local pouchDB. Does it work?
Then there comes the merge problem. We need to make sure data.json always has the most up-to-date custom prompts. Seems we need every CRUD operation in pouchDB to also apply to data.json. Then it seems we don't need pouchDB at all? For a bigger vector db pouchDB could still have better performance though, and we only do data.json loads or dumps at specific times.
Just thinking out loud, please let me know if there are better ideas. I'm AFK this week but will get to this one when I'm back.
Syncing to data.json seems like the path of least resistance, but I do agree that it makes puochDB redundant. I don't know enough about the performance of larger vector dbs, but it doens't sound like pouchDB is well suited for syncing across devices.
If it were me, I would consider dropping pouchDB and writing to the filesystem as that's what obsidian does for everything else anyway.
Looking forward to this feature!
It would be great if custom prompts could exist as markdown files on disc instead of being persisted via pouchdb/indexed db. Just specify a folder that custom prompts exist in like you can for templates within obsidian.
Re embeddings it would definitely be useful to have the embeddings sync with the obsidian vault so they can be reused across devices without needing to re-embed everything.
@logancyang is this something desirable right now? Would a PR in this direction get merged? At least for the custom prompt folder which seems like a much lower touch change.
I'm thinking if a custom prompt directory is specified then it will read from there and merge into existing pouchdb index before proceeding (potentially also write new prompts into that directory if they are created). That way the existing tooling for managing custom prompts still works, you can just optionally store them in a local directory within the vault.
Yeah. I’d love to see all prompts (including both custom prompts and default ones) as md files too.
This problem doesn't seem to be solved yet? I can't sync copliot custom prompts in mac and win!
+1
Will look into this shortly since mobile support is out.