Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsidian integration #186

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Di3mex
Copy link
Contributor

@Di3mex Di3mex commented Sep 14, 2023

My workflow

Asking the question 268099701-931ff113-ad9c-4ac0-99f8-e67d6d509aa1

  • As Obsidian is more or less a webbrowser at its core, GPT-Researcher can be opened as a browser tab. This is achieved by installing the Surfing plugin inside Obsidian, which allows me to have browser tabs alongside notes.
  • Now I can ask my question directly inside Obsidian

Export to Obsidian

268101884-c1bae026-a1fa-4314-b355-b41868069391

  • Wait until report is finished, press button to export the report using the send to obsidian button.

Read and continue 268099819-57edf079-b2b8-4f3c-b8a0-500fa10fed1b

  • Now that the text is a note in obsidian, I can work with it, find other related notes and ask follow up questions.

Implementation

Key points

  • Uses Obsidian Local REST API plugin
  • Configurable Obsidian template
  • Direct export to obsidian with a single click
  • Configurable folder inside obsidian

Details

  • This implementation requires the user to install the Local REST API plugin in Obsidian.
  • There is a simple markdown template with two placeholders for the agent output and research report. These are filled by GPT researcher. Additionally there are templater variables like the current date, a link to the current daily note. These will be automatically filled by Templater when the rest request is received in Obsidian. Of course all templater variables can be used.

Limitations

  • The Local REST API is a bit of a pain to setup. By default it uses a HTTPS connection which requires the client to accept the self signed certificate. In this case a command needs to be run so that the python env trusts the certificate. Not 100% sure anymore, but that has to be documented.
  • This is the first time since 2011 that I have worked with javascript. I am open to feedback on how to improve the code.

Outlook

  • I currently need to wait for the export to finish, before I can press the button to export. It would be even cooler if the export to Obsidian could be done automatically when its complete. This could be a config option OBSIDIAN_AUTO_EXPORT=true.

Maximilian Morgalla and others added 9 commits August 29, 2023 18:20
feat(client/index.html, client/scripts.js): add "Send to Obsidian" button to export research reports to Obsidian

feat(config/config.py): add OBSIDIAN_TOKEN environment variable to store Obsidian API token

feat(main.py): add POST endpoint /obsidian to send research reports to Obsidian
…assignment

fix(main.py): ensure base_url ends with a forward slash to avoid URL concatenation issues
fix(main.py): remove unnecessary whitespace before url variable assignment
Disable buttons before research is generated.
Gives ability to generate consecutive obsidian exports.
@Di3mex
Copy link
Contributor Author

Di3mex commented Sep 14, 2023

My PR includes a minor change in that the copytoclipboard and send to obsidian button are disabled until a research report is generated.

@assafelovic
Copy link
Owner

Thank you @Di3mex for this awesome contribution, let us review it in the coming week and update. It holds great potential but will require additional installation steps from users, so we need to consider how to best structure it.

@assafelovic
Copy link
Owner

also @Di3mex please see conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants