Help us improve
Share bugs, ideas, or general feedback.
From logseq-expert
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.
npx claudepluginhub c0ntr0lledcha0s/claude-code-plugin-automations --plugin logseq-expertHow this skill is triggered — by the user, by Claude, or both
Slash command
/logseq-expert:reading-logseq-dataThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill auto-invokes when:
Builds and maintains an LLM-curated personal knowledge base of markdown files from ingested sources (papers, articles, notes). Compiles sources once into structured, cross-referenced wiki pages to accumulate knowledge over time.
Inspects, edits, organizes, and analyzes local Obsidian vault notes, YAML frontmatter, wikilinks, graph structure, and schema. Useful for vault maintenance and bulk edits.
Share bugs, ideas, or general feedback.
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 |
from logseq_client import LogseqClient
client = LogseqClient()
page = client.get_page("My Page")
print(f"Title: {page['title']}")
print(f"Properties: {page['properties']}")
# 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")
# 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]}...")
[:find (pull ?p [:block/title])
:where
[?p :block/tags ?t]
[?t :db/ident :logseq.class/Page]]
[:find (pull ?b [*])
:where
[?b :block/tags ?t]
[?t :block/title "Book"]]
[:find ?title ?author
:where
[?b :block/title ?title]
[?b :user.property/author ?author]
[?b :block/tags ?t]
[?t :block/title "Book"]]
[: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"]]
[:find (pull ?b [:block/title {:block/page [:block/title]}])
:in $ ?page-title
:where
[?p :block/title ?page-title]
[?b :block/refs ?p]]
;; Count books per author
[:find ?author (count ?b)
:where
[?b :block/tags ?t]
[?t :block/title "Book"]
[?b :user.property/author ?author]]
from 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"
)
try:
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")
# 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:
# 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.
# 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