Logseq is an open-source knowledge management tool built around bidirectional linking, daily journals, and a graph view of connected notes. Its AI features — query answering, content generation, summarisation — can be backed by any OpenAI-compatible API, which means you can connect them to Ollama for fully local, private knowledge management. Your notes never leave your machine, queries run on your own hardware, and there are no per-query costs. This guide covers how to set up the Logseq-Ollama connection, what the AI features can do, and practical workflows for using local AI with your Logseq knowledge base.
Logseq AI Plugin Options
Logseq does not have native Ollama support built in — you need a plugin. The two main options are the Logseq GPT3 OpenAI plugin and the community Logseq AI plugin (sometimes called logseq-plugin-gpt3). Both work by calling an OpenAI-compatible API, which means you can redirect them to Ollama with a few configuration changes. The GPT3 plugin is more widely used and better documented. Search for it in Logseq’s Plugin Marketplace (the puzzle icon in the toolbar) and install it.
Configuring the GPT3 Plugin to Use Ollama
After installing the plugin, go to Logseq Settings (three dots top right) and find the GPT3 plugin settings. You need to change two fields: the API endpoint and the model name. Set the API endpoint to your Ollama OpenAI-compatible URL: http://localhost:11434/v1. For the API key, enter any non-empty string — “ollama” works. Set the model to whatever Ollama model you want to use, for example “llama3.2” or “qwen2.5:7b”. Save the settings. The plugin now routes all requests through Ollama rather than the OpenAI API.
If you’re on a Mac and Logseq is in a sandbox, localhost calls may be blocked. In that case, run Ollama and configure it to listen on all interfaces: set OLLAMA_HOST=0.0.0.0:11434, then use http://127.0.0.1:11434/v1 as the endpoint. This sometimes resolves sandboxing issues that block localhost.
Basic AI Commands in Logseq
With the plugin configured and Ollama running, you can invoke AI commands from within Logseq pages. The most common workflow: type your prompt or question in a block, then trigger the AI command via the slash menu (type / in a block). The plugin sends your prompt to Ollama and inserts the response as a new block below. For summarising a page, select the relevant blocks, copy them into a new block with your summarisation prompt, and trigger the command. For generating content from an outline, write your bullet points and ask the AI to expand each one into a paragraph.
Figure 1 — Logseq + Ollama: How the AI Plugin Connects
Practical Workflows: AI-Assisted Note-Taking
The most immediately useful Logseq + Ollama workflows are the ones that fit naturally into how you already use Logseq. A few that work particularly well:
Summarising reading notes. When you finish taking notes on an article or book chapter, add a block that says “Summarise the key points above in 3 bullet points” and trigger the AI command. The plugin sends your selected blocks as context. The result goes into your notes automatically. This is faster than writing your own summary and forces the AI to pull out the most important points from exactly what you captured.
Generating questions for review. Add a block asking the AI to generate five questions based on your notes on a topic. Logseq’s block reference system lets you then use those questions as review prompts when revisiting the topic later. Effective for building a personal spaced repetition system without a separate app.
Expanding bullet outlines. Write an outline for a document you need to produce — meeting agenda, project plan, blog post — then ask the AI to expand each bullet into a paragraph. The output goes directly into your Logseq graph where you can refine and reorganise it using Logseq’s block manipulation tools.
Linking ideas across pages. Describe a concept you’re working on and ask the AI to suggest related concepts, alternative framings, or connections to adjacent ideas. Use the responses to identify terms worth creating Logseq pages for, which then show up in the graph view as connected nodes — building the associative structure of your knowledge graph with AI assistance.
Choosing the Right Model for Logseq AI
Logseq AI interactions are typically short prompts with moderate-length responses — summarising a page of notes, expanding an outline, generating questions. This makes 3B–7B models fast enough to feel snappy and capable enough for the task. Llama 3.2 3B works well for simple summarisation and question generation where response time matters more than nuance. Llama 3.1 8B or Qwen 2.5 7B handles more complex tasks — synthesising across long notes, writing expanded paragraphs from outlines — without being impractically slow. For a Logseq workflow where AI assistance is a regular part of note-taking, keeping a 3B model loaded (fast for quick commands) alongside a 7B model for more substantial tasks is a practical split — switch the plugin’s model setting depending on what you need. The model switch takes 15–30 seconds the first time but the model stays warm for subsequent commands within the keep-alive window.
Figure 2 — AI Commands That Work Well in Logseq
Logseq Queries vs AI Queries: Different Tools
Logseq has its own powerful built-in query system (Datalog queries and advanced queries) for finding and aggregating information across your graph — finding all tasks due this week, all pages tagged with a specific topic, all blocks mentioning a certain term. These queries work on the structure and metadata of your notes rather than their meaning. AI queries via Ollama work on the meaning and content of notes rather than their structure. The two are complementary: use Logseq’s native queries to find and surface relevant blocks, then use AI to synthesise or summarise what you find. A practical pattern: run a Logseq query to collect all blocks tagged [[project-alpha]], copy the results into a new page, then ask the AI to summarise the current state of the project. The query handles retrieval from your graph; the AI handles synthesis from the retrieved content.
Troubleshooting Plugin Connection Issues
The most common issue is the plugin not connecting to Ollama despite correct settings. Check these in order: confirm Ollama is running by testing http://localhost:11434 in your browser — you should see “Ollama is running”. Confirm the plugin API endpoint is set to http://localhost:11434/v1 with the trailing slash and correct port. Check that the model name in the plugin settings exactly matches an installed model name as shown by ollama list. If you’re on macOS and getting connection refused, check whether Logseq’s sandbox is blocking localhost calls and try 127.0.0.1 instead. If the plugin times out rather than refusing connection, your model may be loading slowly — set OLLAMA_KEEP_ALIVE to a longer duration so the model stays warm between commands. Also check that the Ollama model you’ve specified is actually downloaded — a model name typo will cause Ollama to try pulling it, which looks like a timeout from the plugin’s perspective.
Privacy and Logseq: The Local Advantage
The fundamental reason to use Ollama rather than the OpenAI API for Logseq AI is privacy. Logseq is widely used for personal knowledge management that includes sensitive notes — medical records, financial planning, personal journals, confidential work materials. Sending this content to OpenAI’s API, even with their data policies, is a meaningful privacy trade-off that many users reasonably want to avoid. With Ollama, every AI query stays on your machine. The plugin sends your note content to Ollama running locally, Ollama processes it, and the response comes back — no data leaves your computer. For users who have specifically chosen Logseq’s local-first architecture for its privacy properties, running AI locally via Ollama is the natural extension of that same philosophy. It requires more setup than entering an API key, but the outcome is a knowledge management system where both your data and your AI queries are genuinely private.
Alternatives: Other Logseq AI Integrations
Beyond the GPT3 plugin, a few other Logseq AI integrations are worth knowing about. The Logseq Smart Search plugin adds semantic search to your graph using embeddings — you can configure it to use Ollama’s embedding endpoint for fully local semantic search across all your notes. This is different from the GPT3 plugin’s generation capabilities but equally valuable for surfacing relevant notes based on meaning rather than keyword matching. For users comfortable with self-hosted tools, Logseq’s syncing can be combined with a local RAG system (using LlamaIndex or ChromaDB with Ollama) to create a fully searchable, AI-queryable version of your entire knowledge base that runs independently of the Logseq app. This is more complex to set up but gives you query capabilities beyond what the in-app plugins provide. The combination of Logseq’s bidirectional linking for note organisation and Ollama-backed AI for content generation and synthesis represents a compelling fully local, fully private approach to AI-assisted knowledge management that avoids every privacy and cost concern of cloud-based alternatives.