Skip to content

Commit a395ad0

Browse files
committed
docs: add comprehensive ChatGPT Actions setup guide to README
1 parent 5e92f29 commit a395ad0

1 file changed

Lines changed: 107 additions & 26 deletions

File tree

README.md

Lines changed: 107 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -376,53 +376,134 @@ Notes that don't match any signal with sufficient confidence stay in place. Dail
376376

377377
## ChatGPT Actions
378378

379-
`engraph serve --http` can expose your vault to ChatGPT as a custom Action. engraph generates a standards-compliant OpenAPI 3.1.0 spec and a ChatGPT plugin manifest automatically.
379+
Connect your Obsidian vault to ChatGPT as a custom GPT Action. ChatGPT can search, read, create, and edit your notes through engraph's REST API.
380380

381-
**Set up:**
381+
### Prerequisites
382+
383+
- engraph installed and indexed (`engraph index ~/your-vault`)
384+
- A tunnel tool: [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-local-tunnel/) (recommended) or [ngrok](https://ngrok.com)
385+
386+
### Step 1: Configure engraph
382387

383388
```bash
389+
# Interactive setup — enables HTTP, creates API key, sets CORS
384390
engraph configure --setup-chatgpt
385391
```
386392

387-
Interactive helper that:
388-
1. Enables HTTP mode (if not already on)
389-
2. Creates a write-permission API key
390-
3. Configures CORS for `https://chat.openai.com`
391-
4. Prompts for your public URL (ngrok or similar)
393+
Or configure manually in `~/.engraph/config.toml`:
394+
395+
```toml
396+
[http]
397+
enabled = true
398+
port = 3000
399+
host = "127.0.0.1"
400+
rate_limit = 60
401+
cors_origins = ["https://chat.openai.com", "https://chatgpt.com"]
392402

393-
**Endpoints served automatically (no auth required):**
403+
[[http.api_keys]]
404+
key = "eg_your_key_here" # generate with: engraph configure --add-api-key --key-name chatgpt --key-permissions write
405+
name = "chatgpt"
406+
permissions = "write" # "read" for search-only, "write" to also create/edit notes
394407

395-
| Endpoint | Description |
396-
|----------|-------------|
397-
| `GET /openapi.json` | OpenAPI 3.1.0 spec for all 23 endpoints |
398-
| `GET /.well-known/ai-plugin.json` | ChatGPT plugin manifest |
408+
[http.plugin]
409+
name = "My Vault"
410+
description = "Search and manage my Obsidian vault"
411+
public_url = "https://your-tunnel-url.trycloudflare.com" # set after starting tunnel
412+
```
399413

400-
**Quick setup steps:**
414+
### Step 2: Start engraph + tunnel
401415

416+
**Terminal 1 — engraph HTTP server:**
402417
```bash
403-
# 1. Run the setup helper
404-
engraph configure --setup-chatgpt
405-
406-
# 2. Start engraph with HTTP
407418
engraph serve --http
419+
```
408420

409-
# 3. Expose via tunnel (example with ngrok)
410-
ngrok http 3030
421+
**Terminal 2 — Cloudflare tunnel:**
422+
```bash
423+
cloudflared tunnel --url http://localhost:3000
424+
# Prints a URL like: https://abc-xyz.trycloudflare.com
425+
```
411426

412-
# 4. In ChatGPT → Explore GPTs → Create → Configure → Add Action
413-
# Import from URL: https://<your-ngrok-url>/openapi.json
427+
Or with ngrok:
428+
```bash
429+
ngrok http 3000
430+
# Prints a URL like: https://abc123.ngrok-free.app
414431
```
415432

416-
**Plugin config in `~/.engraph/config.toml`:**
433+
### Step 3: Update config with tunnel URL
434+
435+
Edit `~/.engraph/config.toml` and set `public_url` to your tunnel URL:
417436

418437
```toml
419438
[http.plugin]
420-
name = "My Vault"
421-
description = "Search and read my personal knowledge base"
422-
contact_email = "you@example.com"
423-
public_url = "https://abc123.ngrok.io"
439+
public_url = "https://abc-xyz.trycloudflare.com"
424440
```
425441

442+
Then restart engraph (`Ctrl+C` and re-run `engraph serve --http`). This ensures the OpenAPI spec points to the correct public URL.
443+
444+
### Step 4: Verify endpoints
445+
446+
```bash
447+
# Both should return JSON (no auth required)
448+
curl https://your-tunnel-url/openapi.json
449+
curl https://your-tunnel-url/.well-known/ai-plugin.json
450+
451+
# Search with auth
452+
curl -X POST -H "Authorization: Bearer eg_your_key" \
453+
-H "Content-Type: application/json" \
454+
-d '{"query": "test search"}' \
455+
https://your-tunnel-url/api/search
456+
```
457+
458+
### Step 5: Register in ChatGPT
459+
460+
1. Go to [ChatGPT](https://chat.openai.com)**Explore GPTs****Create**
461+
2. Give your GPT a name (e.g., "Vault Assistant")
462+
3. Add these **Instructions**:
463+
464+
```
465+
You are a knowledge assistant connected to the user's Obsidian vault via engraph.
466+
467+
WORKFLOW:
468+
1. Use searchVault to find relevant notes before answering questions
469+
2. Use readNote for full content, readSection for specific headings
470+
3. Use getWho for people context, getProject for project context
471+
4. Use getVaultMap to orient yourself in the vault structure
472+
5. Only create or edit notes when explicitly asked
473+
474+
SEARCH TIPS:
475+
- Temporal queries ("last week", "yesterday") activate time-aware search automatically
476+
- Results include confidence % — prefer higher confidence matches
477+
- Fuzzy matching works: typos in names are handled
478+
479+
STYLE:
480+
- Reference vault notes by name when answering
481+
- Quote relevant snippets
482+
- If information isn't in the vault, say so clearly
483+
- Be concise
484+
```
485+
486+
4. Click **Add Action****Import from URL**
487+
5. Enter: `https://your-tunnel-url/openapi.json`
488+
6. Click the **gear icon** next to Authentication
489+
7. Select **API Key**, Auth Type: **Bearer**
490+
8. Paste your API key (the `eg_...` key from Step 1)
491+
9. **Save** and test
492+
493+
### Conversation starters
494+
495+
- "What happened in my vault last week?"
496+
- "Summarize my current work projects"
497+
- "Find notes related to [topic]"
498+
- "Create a note about today's meeting with [person]"
499+
500+
### Notes
501+
502+
- **Tunnel URLs are temporary** (Cloudflare quick tunnels change on restart). For persistent URLs, set up a [named Cloudflare tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-local-tunnel/) or use ngrok with a reserved domain.
503+
- **Read-only mode**: set `permissions = "read"` on the API key if you don't want ChatGPT to create or modify notes.
504+
- **Rate limiting**: default is 60 requests/minute per key. Adjust `rate_limit` in config if needed.
505+
- **engraph must be running** on your machine for ChatGPT to access it. If you close the terminal, the connection drops.
506+
426507
## Use cases
427508

428509
**AI-assisted knowledge work** — Give Claude or Cursor deep access to your personal knowledge base. Instead of copy-pasting context, the agent searches, reads, and cross-references your notes directly.

0 commit comments

Comments
 (0)