Add Memos as a note destination - #372
Open
timothy-s-dev wants to merge 1 commit into
Open
timothy-s-dev wants to merge 1 commit into
timothy-s-dev wants to merge 1 commit into
Conversation
Memos (usememos.com) is a self-hosted note server. Index can now send notes to one: the user adds a server URL and an access token under Add Integration, and notes are created through the Memos REST API. Failures throw rather than returning null, so a note that never reached the server is not reported back as saved. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DUY4mJgUJtvvjXarmyrUcn
Author
|
Was thinking about this some more this morning and it occurred to me that perhaps a better solution here would be expanding the webhook functionality to allow using json instead of formdata, and let the user specify a format/schema. Would theoretically add support for more than just this one new potential integration target. Happy to take a swing at that instead, if it would fit better. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have a self-hosted Memos server that I was previously using for saving voice memos with a "shake" gesture on my phone. Now that my Index 01 has arrived, I'd like to set it up to point at the same thing.
I looked at potentially doing this with webhooks or tasker, but the former would send form-data instead of the json blob Memos would recognize, and the latter was going to involve a fair bit of setup, and a paid app I don't currently own. So I opted to try and build it into the app as another integration option. I figured I'd open a PR here, in case it seemed like an integration that might be useful to anyone else.
This was done AI assisted, but under careful manual guidance, and I think I've landed on a reasonable implementation. I've been able to test through the flow (configure the integration, type a note, submit with local llm, and see it show up on my server) on an Android emulator. I don't have an iOS device available, so I've only been able to do the CI build for that one, although I can't see any obvious reason it wouldn't work.
I tried to mostly follow the existing patterns established by the Obsidian and Notion integrations, but may have missed some things. I did opt to put the new integration into a subdirectory in
integrations/like obsidian, to try and keep things organized as best as I could. I also added another test similar to theNotionNoteClientIntegrationTestcalledMemosApiIntegrationTest, that hits a real server, pulling credentials from env vars or gradle props (@Ignore'd by default, like the notion one, to keep it out of the CI test runs where there aren't credentials available).On a mostly unrelated note, I did notice while I was building this that there doesn't currently appear to be any way to edit an integration setup once it's been added. Discovered that the hard way after accidentally typo-ing the URL and having to reset the emulator to do it again from scratch. Not something I wanted to scope-creep into this PR, but figured I'd mention it anyway.