obsidian-copilot icon indicating copy to clipboard operation
obsidian-copilot copied to clipboard

[FR] Support direct links in custom prompt template

Open willis7 opened this issue 1 year ago • 2 comments

Feature request: I maintain a daily note for every day of the week. This is where I log stuff for the day, capture insights and challenges. At the end of the week I produce a weekly note summarising the days for that week. The weekly note looks something like this:

# Week X 2024

## Days of the week
[[day 1]]
[[day 2]]
[[day 3]]
...

## Summary

I would like to be able to say "summarise Week x 2024" and have the copilot read the contents of each link to establish context and then produce the summary. It would be nice to have a setting to pick depth also i.e depth 2 to go into the links of a linked page.

Other options explored:

https://github.com/irbull/obsidian-ai-summary

The above plugin does this, minus the depth selector, but it isn't actively maintained.

I could produce a prompt where I manually lists the days of the week. However, I feel this would become tedious very quickly

willis7 avatar Mar 04 '24 20:03 willis7

This was brought up before under a yt video I believe, the request is mainly for MOC-type notes. I think the best way is to have a syntax in the template to include N degrees of connection. But since the context window can quickly be overwhelmed if N>1, we could simply enable distance 1 first, but with direction.

  • {[[noteTitle]]->}: include all linked notes
  • {[[noteTitle]]<-}: include all back-linked notes
  • {[[noteTitle]]<->}: the sum of the above

How does that sound? @willis7

logancyang avatar Mar 05 '24 00:03 logancyang

It's been a while since I last tried copilot as this was my primary use case, and while this FR is open, I see there's been a lot of development. Is it possible to perform this action now via another feature?

willis7 avatar Sep 17 '24 11:09 willis7

Also wondering about this.

It's something I've been able to do in Python and then run against my own local model but feels like I'm reinventing the wheel.

Edit: Actually adding this to llama-index so you can play with it in Python: https://github.com/run-llama/llama_index/pull/17699

I use the reader and then have a separate function that take linked notes, extracts text into pyperclip to paste into a model. Or you can build local rag too.

bitsofchris avatar Jan 30 '25 01:01 bitsofchris