Skip to content

Latest commit

ย 

History

History
337 lines (237 loc) ยท 13 KB

README.en.md

File metadata and controls

337 lines (237 loc) ยท 13 KB

English | ไธญๆ–‡

๐Ÿง  Obsidian + OpenCode AI Knowledge Base

A local AI knowledge management solution for non-technical users. No coding required, one-click deployment, ready to use out of the box.

License: MIT GitHub stars OpenCode

Note: This project was originally designed for Chinese users, but international users are welcome! The interface and documentation can be adapted for English usage.


โœจ Key Features

Feature Description
๐Ÿ“ฅ Auto Ingest Drop articles, PDFs, screenshots to AI, automatically organized into structured notes
๐Ÿ“ฑ Social Media Collection Xiaohongshu, Douyin, Twitter, Weibo and more โ€” auto-classify, analyze, and digest into knowledge (powered by OpenCLI)
๐Ÿ” Smart Query Chat with AI: "Have I written about XX before?"
๐Ÿฅ Regular Health Check AI automatically checks knowledge base health, finds broken links, duplicates, orphaned pages
๐Ÿ”’ Fully Local All data stays on your computer, no cloud upload
๐Ÿ› ๏ธ One-Click Deploy Run the script, setup completes in 5 minutes

๐Ÿš€ Quick Start

Option 1: Let AI Deploy for You (Zero Effort)

Send this message to any AI assistant (ChatGPT, Claude, GLM, etc.) and it will handle the entire deployment automatically:

Deploy an AI knowledge base for me: https://github.com/zxfccmm4/Obsidian-OpenCode-Knowledge/blob/main/GUIDE_FOR_AI.md

๐Ÿ“– The AI assistant will read GUIDE_FOR_AI.md for the complete deployment procedure, including environment checks, installation, and configuration.

Option 2: Manual Installation (3 Steps)

# Step 1: Clone the repository
git clone https://github.com/zxfccmm4/Obsidian-OpenCode-Knowledge.git
cd Obsidian-OpenCode-Knowledge/deploy

# Step 2: Run the setup script (macOS)
bash setup.sh

# Step 3: Open the generated "My Knowledge Base" folder in Obsidian

๐Ÿ“– For detailed steps, see deployment-guide.md (Chinese deployment guide)

What setup.sh Does

The setup script handles everything automatically:

  1. Checks Node.js โ€” verifies Node.js is installed, offers to install via Homebrew if missing
  2. Installs OpenCode โ€” installs the OpenCode CLI tool globally via npm
  3. Installs OpenCLI โ€” installs the CLI tool for web automation and social media scraping (87+ site adapters)
  4. Creates Your Vault โ€” copies the vault-template/ to your chosen location
  5. Configures AI Service โ€” choose from 6 providers (Zhipu GLM, Anthropic, OpenAI, Google Gemini, OpenRouter, DeepSeek)
  6. Sets Up Obsidian Plugin โ€” generates configuration for the opencode-obsidian plugin

๐Ÿ—๏ธ Architecture Overview

This solution works with three components:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚   Obsidian  โ”‚โ—„โ”€โ”€โ–บโ”‚  OpenCode   โ”‚โ—„โ”€โ”€โ–บโ”‚   AGENTS.md โ”‚ โ”‚
โ”‚  โ”‚ (Notes App) โ”‚    โ”‚  (AI Agent) โ”‚    โ”‚  (AI Rules) โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Component Purpose What It Means for You
Obsidian Local note-taking app Write notes like using a regular notebook
OpenCode AI model interface Chat with AI directly in Obsidian
AGENTS.md AI behavior guide AI knows how to organize, query, and check your knowledge base

๐Ÿ“ Directory Structure

After installation, your knowledge base structure looks like this:

My Knowledge Base/
โ”œโ”€โ”€ ๐Ÿ“„ AGENTS.md              # AI rules (system-maintained)
โ”œโ”€โ”€ ๐Ÿ“„ AI_CONFIG.md           # โš™๏ธ AI configuration (user-customizable)
โ”œโ”€โ”€ ๐Ÿ“ raw/                   # Raw materials (PDFs/articles/screenshots)
โ”‚   โ”œโ”€โ”€ organized by topic...
โ”‚   โ””โ”€โ”€ ๐Ÿ“ social/            # Social media raw content (by knowledge domain)
โ”‚       โ”œโ”€โ”€ consumer-research/ # Reviews, comparisons, recommendations
โ”‚       โ”œโ”€โ”€ skills-methods/    # Tutorials, guides, best practices
โ”‚       โ”œโ”€โ”€ industry-insights/ # Trends, business analysis
โ”‚       โ”œโ”€โ”€ lifestyle/         # Travel, food, fashion, home
โ”‚       โ”œโ”€โ”€ opinions/          # Commentary, value perspectives
โ”‚       โ”œโ”€โ”€ creative/          # Design, copywriting, marketing cases
โ”‚       โ””โ”€โ”€ resources/         # Tool recommendations, book lists
โ”œโ”€โ”€ ๐Ÿ“ wiki/                  # AI-organized notes
โ”‚   โ”œโ”€โ”€ index.md              # ๐Ÿ“‡ Global index (auto-updated by AI)
โ”‚   โ”œโ”€โ”€ log.md                # ๐Ÿ“ Operation log (auto-recorded by AI)
โ”‚   โ””โ”€โ”€ topic notes...        # Including digested social media knowledge
โ”œโ”€โ”€ ๐Ÿ“ assets/                # Image assets
โ””โ”€โ”€ ๐Ÿ“ .opencode/
    โ””โ”€โ”€ ๐Ÿ“ skill/             # AI skills (9 pre-installed)
        โ”œโ”€โ”€ obsidian-cli/     # Obsidian operation capabilities
        โ”œโ”€โ”€ obsidian-markdown/ # Markdown generation capabilities
        โ”œโ”€โ”€ defuddle/         # Web content extraction capabilities
        โ”œโ”€โ”€ opencli-usage/    # OpenCLI command reference (87+ adapters)
        โ”œโ”€โ”€ smart-search/     # Intelligent search router
        โ”œโ”€โ”€ opencli-browser/  # Browser automation
        โ”œโ”€โ”€ opencli-autofix/  # Adapter auto-repair
        โ”œโ”€โ”€ opencli-explorer/ # Adapter development guide
        โ””โ”€โ”€ opencli-oneshot/  # Quick CLI generation

Pre-installed Skills

The template comes with 9 pre-installed skills in vault-template/.opencode/skill/:

Skill Purpose
obsidian-cli Read, create, search notes in your Obsidian vault
obsidian-markdown Generate and edit Obsidian-flavored Markdown
defuddle Extract clean content from web pages
opencli-usage OpenCLI command reference (87+ site adapters)
smart-search Intelligent search router across multiple platforms
opencli-browser Browser automation for AI agents
opencli-autofix Automatically fix broken site adapters
opencli-explorer Guide for creating new site adapters
opencli-oneshot Quick 4-step template for adding a single command

๐Ÿ“ Daily Usage Examples

๐Ÿ“ฅ Ingest (Add to Knowledge Base)

Drop content you want to save to AI:

Add this to my wiki:
[paste article content / web link / describe what you want to record]

AI will automatically:

  • Save raw materials to the raw/ directory
  • Organize into structured notes in wiki/
  • Update the global index and operation log

๐Ÿ“ฑ Social Media Collection (Social Ingest)

After scraping content from Xiaohongshu, Douyin, Twitter, Weibo, etc. (using tools like opencli):

Scraped this:
[paste scraped note content]
Add this Xiaohongshu post

AI will automatically:

  • Classify by knowledge domain (consumer research / skills & methods / industry insights / lifestyle / opinions / creative inspiration / resources)
  • Assess credibility (sponsored content detection, evidence quality)
  • Archive raw content to raw/social/<domain>/

OpenCLI supports automatic content scraping via Chrome browser, reusing your login sessions. See OpenCLI project.

  • Digest and merge or create wiki articles (removing social media slang, keeping useful info)
  • Auto-merge multiple posts on the same topic (e.g., multiple cafรฉ reviews โ†’ city cafรฉ guide)
  • Update global index and operation log

Supported platforms: Xiaohongshu, Douyin, Twitter/X, Weibo, Bilibili, WeChat, etc.


๐Ÿ” Query (Search Knowledge)

Ask AI like chatting:

What does my wiki have about project management?
Based on my notes, summarize my views on AI tools
Compare the two learning methods I wrote about in my wiki

๐Ÿฅ Lint (Health Check)

Run weekly:

lint wiki

AI will check:

  • โœ… Index file consistency with actual files
  • โœ… Internal link validity
  • โœ… Orphaned pages (pages no one links to)
  • โœ… Cross-article fact consistency

๐Ÿ”ง Advanced Options (Optional)

The basic version works great. Add these features on demand by simply telling OpenCode to install them:

Feature Install Command Purpose
๐Ÿ“„ PDF Export "Install minimax-pdf skill" Export notes to professional PDF
๐Ÿ“ Word Export "Install minimax-docx skill" Generate Word documents
๐Ÿ“Š Excel Reading "Install minimax-xlsx skill" Read Excel data
๐ŸŽจ PPT Generation "Install pptx-generator skill" Turn notes into presentations
๐Ÿ–ผ๏ธ Image Analysis "Install vision-analysis skill" Analyze images and screenshots

โ“ FAQ

Q0: How do I customize AI behavior?

Edit AI_CONFIG.md in your knowledge base root directory. You can customize:

  • Knowledge domains: Add/remove/modify categories (e.g., add "Academic Notes")
  • Trigger words: Change keywords that activate AI operations
  • Output language: Switch to English content processing
  • Social platforms: Add new platforms
  • Lint checks: Enable/disable individual health checks
  • Custom rules: Write additional rules in the user-custom-rules section

Changes take effect on the next conversation โ€” no restart needed.

Q1: I don't have a technical background. Can I still use this?

Absolutely! This is designed specifically for non-technical users. Just follow the deployment-guide.md step by step. No programming knowledge needed.


Q2: Is my data secure?

Very secure:

  • โœ… All data stays on your own computer, no cloud upload
  • โœ… Raw materials in raw/ are never modified by AI
  • โœ… Notes are plain Markdown files, easy to copy and backup anytime

Q3: Can I use other AI services?

Yes! The setup script supports 6 providers โ€” choose your preferred one during installation:

Provider Highlights
Zhipu GLM โญ Chinese service, great for Chinese users
Anthropic Claude series models
OpenAI GPT series models
Google Gemini Gemini series models
OpenRouter Multi-model gateway, one key for many models
DeepSeek Chinese service, cost-effective

Just paste your API Key and the config is generated automatically. Want to switch later? Edit ~/.config/opencode/opencode.json.


Q4: What if installation fails?

  1. Make sure your Mac is running macOS 12 or later
  2. Make sure your computer has internet access
  3. Take a screenshot of the error message in terminal and open an Issue

Q5: How is this different from using ChatGPT directly?

Feature ChatGPT This Solution
Data Storage Cloud Local
Long-term Memory Session-level Permanent
Structured Organization Manual AI-auto
File Associations Not supported Supported

๐Ÿค Contributing

Issues and Pull Requests are welcome!


๐Ÿ“„ License

This project is licensed under the MIT License.

You are free to use, modify, and distribute, just keep the copyright notice.


๐Ÿ™ Acknowledgments

Thanks to these projects and teams for their support:


Made with โค๏ธ for knowledge seekers

โญ Star this project ยท ๐Ÿ› Submit Issue ยท ๐Ÿ’ฌ Join Discussion