Skip to content

Instantly share code, notes, and snippets.

@business24ai
Created December 31, 2023 11:29
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save business24ai/ffc275267b9c928805756fe6dace19b0 to your computer and use it in GitHub Desktop.
Save business24ai/ffc275267b9c928805756fe6dace19b0 to your computer and use it in GitHub Desktop.
An AutoGen Studio skill to store markdown content to our second brain obsidian
# A skill to store markdown content to our second brain obsidian
import os
def store_note_to_obsidian(filename, content):
"""
Store markdown content to our second brain in a local Obsidian vault
:param filename: str, filename of the note
:param content: str, content of the note as markdown
"""
# Path to Obsidian vault
obsidian_dir = r'C:/1600/2nd_brain/1600_agent_swarm/'
# Add .md suffix if not present
if not filename.endswith('.md'):
filename += '.md'
# full path prefix obsidian_dir to filename
full_path = os.path.join(obsidian_dir, filename)
# Write content to file
with open(full_path, 'w') as file:
file.write(content)
## To test the skill
#if __name__ == '__main__':
# store_note_to_obsidian("Test", "This is a **test** ==markdown== note!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment