Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Expert in reading data from Logseq DB graphs via HTTP API or CLI. Auto-invokes when users want to fetch pages, blocks, or properties from Logseq, execute Datalog queries against their graph, search content, or retrieve backlinks and relationships. Provides the logseq-client library for operations.
.claude/skills/aiskillstore-reading-logseq-data/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-08 | ✗→✓ | ▲ Improved | 79% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -9% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -25% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 65% | 0% |
This skill auto-invokes when:
Client Library: See {baseDir}/scripts/logseq-client.py for the unified API.
| Operation | Description | |-----------|-------------| | get_page(title) | Get page content and properties | | get_block(uuid) | Get block with children | | search(query) | Full-text search across graph | | datalog_query(query) | Execute Datalog query | | list_pages() | List all pages | | get_backlinks(title) | Find pages linking to this one | | get_graph_info() | Get current graph metadata |
pythonfrom logseq_client import LogseqClient client = LogseqClient() page = client.get_page("My Page") print(f"Title: {page['title']}") print(f"Properties: {page['properties']}")
python# Find all books with rating >= 4 results = client.datalog_query(''' [:find (pull ?b [:block/title :user.property/rating]) :where [?b :block/tags ?t] [?t :block/title "Book"] [?b :user.property/rating ?r] [(>= ?r 4)]] ''') for book in results: print(f"{book['block/title']}: {book['user.property/rating']} stars")
python# Search for mentions of "project" results = client.search("project") for block in results: print(f"Found in: {block['page']}") print(f"Content: {block['content'][:100]}...")
clojure[:find (pull ?p [:block/title]) :where [?p :block/tags ?t] [?t :db/ident :logseq.class/Page]]
clojure[:find (pull ?b [*]) :where [?b :block/tags ?t] [?t :block/title "Book"]]
clojure[:find ?title ?author :where [?b :block/title ?title] [?b :user.property/author ?author] [?b :block/tags ?t] [?t :block/title "Book"]]
clojure[:find (pull ?t [:block/title :logseq.property/status]) :where [?t :block/tags ?tag] [?tag :db/ident :logseq.class/Task] [?t :logseq.property/status ?s] [?s :block/title "In Progress"]]
clojure[:find (pull ?b [:block/title {:block/page [:block/title]}]) :in $ ?page-title :where [?p :block/title ?page-title] [?b :block/refs ?p]]
clojure;; Count books per author [:find ?author (count ?b) :where [?b :block/tags ?t] [?t :block/title "Book"] [?b :user.property/author ?author]]
pythonfrom logseq_client import LogseqClient # Auto-detect backend client = LogseqClient() # Force specific backend client = LogseqClient(backend="http") # Custom URL/token client = LogseqClient( url="http://localhost:12315", token="your-token" )
pythontry: page = client.get_page("Nonexistent Page") except client.NotFoundError: print("Page doesn't exist") except client.ConnectionError: print("Cannot connect to Logseq") except client.AuthError: print("Invalid token")
python# Get multiple pages efficiently pages = ["Page1", "Page2", "Page3"] results = [client.get_page(p) for p in pages] # Or use a single query query = ''' [:find (pull ?p [*]) :in $ [?titles ...] :where [?p :block/title ?titles]] ''' results = client.datalog_query(query, [pages])
(pull ?e [:needed :fields]) vs [*]:in clauseIf HTTP API unavailable, the client falls back to CLI:
python# CLI mode (automatic if HTTP fails) client = LogseqClient(backend="cli", graph_path="/path/to/graph") # Query still works the same way results = client.datalog_query("[:find ?title :where [?p :block/title ?title]]")
Returns Python dicts/lists directly from API.
python# Get normalized output page = client.get_page("My Page", normalize=True) # Returns: {"title": "...", "uuid": "...", "properties": {...}, "blocks": [...]}
{baseDir}/references/read-operations.md for all operations{baseDir}/templates/query-template.edn for query patterns| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | fail→pass | 11,639 | 12,007 | +3% | 1 | 1 | 0% | 2,075 | 3,707 | +79% | 0 | 0 | — |
case-01 | fail→fail | 15,588 | 21,265 | +36% | 1 | 1 | 0% | 2,027 | 2,260 | +11% | 0 | 0 | — |
case-02 | fail→fail | 12,740 | 6,505 | -49% | 1 | 1 | 0% | 1,197 | 1,701 | +42% | 0 | 0 | — |
case-03 | fail→fail | 11,619 | 22,656 | +95% | 1 | 1 | 0% | 1,082 | 2,263 | +109% | 0 | 0 | — |
case-04 | fail→pass | 16,899 | 9,732 | -42% | 1 | 1 | 0% | 2,344 | 2,195 | -6% | 0 | 0 | — |
case-05 | fail→pass | 26,641 | 12,034 | -55% | 1 | 1 | 0% | 3,036 | 2,752 | -9% | 0 | 0 | — |
case-06 | fail→pass | 19,004 | 3,112 | -84% | 1 | 1 | 0% | 2,698 | 2,031 | -25% | 0 | 0 | — |
case-07 | fail→pass | 15,113 | 12,865 | -15% | 1 | 1 | 0% | 1,712 | 2,822 | +65% | 0 | 0 | — |
case-09 | fail→pass | 18,271 | 4,691 | -74% | 1 | 1 | 0% | 2,314 | 2,396 | +4% | 0 | 0 | — |
case-10 | fail→fail | 9,278 | 12,608 | +36% | 1 | 1 | 0% | 1,531 | 2,713 | +77% | 0 | 0 | — |
case-11 | fail→pass | 13,895 | 9,039 | -35% | 1 | 1 | 0% | 1,540 | 3,137 | +104% | 0 | 0 | — |
case-12 | pass→pass | 18,573 | 12,452 | -33% | 1 | 1 | 0% | 2,455 | 2,793 | +14% | 0 | 0 | — |
case-13 | fail→pass | 17,503 | 11,953 | -32% | 1 | 1 | 0% | 2,137 | 2,627 | +23% | 0 | 0 | — |
case-14 | pass→pass | 20,933 | 15,916 | -24% | 1 | 1 | 0% | 2,359 | 3,362 | +43% | 0 | 0 | — |
case-15 | fail→pass | 21,955 | 11,058 | -50% | 1 | 1 | 0% | 2,819 | 2,506 | -11% | 0 | 0 | — |
case-16 | fail→pass | 14,107 | 3,014 | -79% | 1 | 1 | 0% | 1,627 | 1,914 | +18% | 0 | 0 | — |
case-17 | fail→pass | 18,733 | 5,394 | -71% | 1 | 1 | 0% | 2,547 | 2,484 | -2% | 0 | 0 | — |
case-18 | fail→pass | 13,489 | 6,905 | -49% | 1 | 1 | 0% | 1,436 | 1,754 | +22% | 0 | 0 | — |
case-19 | fail→pass | 30,883 | 3,363 | -89% | 1 | 1 | 0% | 3,334 | 2,064 | -38% | 0 | 0 | — |
case-20 | fail→fail | 17,629 | 23,348 | +32% | 1 | 1 | 0% | 3,168 | 4,910 | +55% | 0 | 0 | — |
case-21 | pass→pass | 13,662 | 18,574 | +36% | 1 | 1 | 0% | 2,350 | 3,821 | +63% | 0 | 0 | — |
case-22 | pass→pass | 17,174 | 16,451 | -4% | 1 | 1 | 0% | 2,137 | 3,516 | +65% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 19 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +59 percentage points is the difference between those two pass rates over the 19 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.