From a03f4701fe521b82b6fa15858119b0e4d6df961d Mon Sep 17 00:00:00 2001 From: Hynek Urban Date: Mon, 6 Apr 2026 10:33:20 +0200 Subject: [PATCH] Add the "AI Clients" integration docs. --- content/docs/integrations/ai.mdx | 106 ++++++++++++++++++++++++++++ content/docs/integrations/index.mdx | 3 + content/docs/integrations/meta.json | 2 +- src/components/ui/card.tsx | 2 + 4 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 content/docs/integrations/ai.mdx diff --git a/content/docs/integrations/ai.mdx b/content/docs/integrations/ai.mdx new file mode 100644 index 00000000..422bd122 --- /dev/null +++ b/content/docs/integrations/ai.mdx @@ -0,0 +1,106 @@ +--- +title: AI +description: Connecting AI clients to Memos. +--- + +There are two main ways of enabling AI clients to work with your Memos +instance: using MCP or using the API directly. + +## MCP + +Memos exposes much of its functionality through an embedded MCP server at `/mcp`. + +First, you will need an API token as described in the [authentication docs](../api/latest#authentication). + +The exact next steps to configure the MCP server will be different for each AI +client. Taking OpenCode as an example, just make sure that the memos MCP server +is properly declared in your `~/.config/opencode/opencode.json`, like this: + +```json +{ + "$schema": "https://opencode.ai/config.json", + "mcp": { + "memos": { + "type": "remote", + "url": "http://localhost:5230/mcp", + "headers": { + "Authorization": "Bearer " + } + } + } +} +``` + +(Do not forget to replace the URL and token with actual values.) + + +## Direct API access + +In some situations, you may want to give agents direct API access instead. One +possible way of doing that is by using an agentic tool called Latchkey. + + +### 1. Install the prerequisites + +Install Latchkey on the machine where the agent will run. That +will allow the agent to send authenticated HTTP requests to the +API without leaking any secrets into prompts. + +1. Make sure your system has a working `node` installation. If not, you can download it from the [official page](https://nodejs.org/en/download). +2. Install Latchkey: + + ```bash + npm install -g latchkey + ``` + +### 2. Generate and Configure the API Token + +1. Get an API token as described in the [authentication docs](../api/latest#authentication). +2. Point Latchkey to your Memos instance, for example: + + ```bash + latchkey services register memos \ + --base-api-url=http://localhost:5230/api/v1 + ``` + +3. Insert the API token: + + ```bash + latchkey auth set memos -H "Authorization: Bearer " + ``` + +### 3. Configure the AI Agent + +Using `skills.sh`: + +```bash +npx skills add imbue-ai/latchkey +``` + +You can also configure the AI agent manually. The exact steps +will differ depending on the agent. Taking OpenCode as an example: + +```bash +mkdir -p ~/.opencode/skills/latchkey +latchkey skill-md > ~/.opencode/skills/latchkey/SKILL.md +``` + +## Using the AI client + +After completing the previous steps, you should now be able to +use your AI client of choice to work with Memos! Here are some +example questions and tasks for an AI agent: + +> I had a note about fixing that issue where my terminal freezes - what was the fix? + +or + +> Find memos that have incomplete task lists. + +or even + +> Here's an article about agentic authorization and credential management. +Summarize it, create a memo with the key takeaways, and link it to my existing +memos on AI tooling. + +From here, it's up to your imagination. diff --git a/content/docs/integrations/index.mdx b/content/docs/integrations/index.mdx index ca93ed29..b4b188b7 100644 --- a/content/docs/integrations/index.mdx +++ b/content/docs/integrations/index.mdx @@ -15,4 +15,7 @@ Memos includes a small set of built-in integrations and supports community proje Community integration for Telegram. + + Connect AI Clients. + diff --git a/content/docs/integrations/meta.json b/content/docs/integrations/meta.json index ed51bfd1..df08795c 100644 --- a/content/docs/integrations/meta.json +++ b/content/docs/integrations/meta.json @@ -1,5 +1,5 @@ { "title": "Integrations", "description": "Connect Memos with third-party services and tools", - "pages": ["index", "rss", "telegram-bot", "webhooks"] + "pages": ["index", "rss", "telegram-bot", "webhooks", "ai"] } diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx index b699d00c..4ff53e71 100644 --- a/src/components/ui/card.tsx +++ b/src/components/ui/card.tsx @@ -1,5 +1,6 @@ import { ActivityIcon, + BotMessageSquareIcon, AlertTriangleIcon, ArrowRightIcon, ArrowUpIcon, @@ -94,6 +95,7 @@ const iconMap: Record = { Puzzle: PuzzleIcon, Terminal: TerminalIcon, Rss: RssIcon, + BotMessageSquare: BotMessageSquareIcon, }; interface CardsProps {