Node Leaf is a visual, node-based RAG (Retrieval-Augmented Generation) studio and prompt orchestration engine. Built in Flutter, it serves as the ultimate power-user client for the Redleaf Knowledge Engine.
Blog Post: https://nathanielwestveer.com/posts/node-leaf/
Instead of chatting with a standard text box, Node Leaf provides an infinite canvas where you can visually wire together Redleaf database queries, agent personas, and prompt instructions, and feed them directly into local LLMs via Ollama.
- Visual Prompt Programming: Drag, drop, and wire nodes together to build complex context chains for your LLM.
- Deep Redleaf API Hooks (True Agency): These aren't just chatbots. Node Leaf agents have programmatic, read-only access to your Redleaf Flask API. They autonomously execute hybrid FTS searches, traverse knowledge graph triplets, and pull specific document pages to gather ground-truth evidence before answering.
- Autonomous Research Loops (ReAct): Use the Deep Study or Research Party nodes to deploy agents that iteratively reason about missing information. Watch in real-time as they formulate search queries, fetch API results, take notes, and recursively hunt for data until they can synthesize a master report.
- Agentic Wiki (Infinite Memory): Build an interconnected, auto-updating local Wiki. Agents read existing Markdown files, research your database to correct semantic drift, and permanently rewrite the files with Git-style version backups.
- Local Wiki Knowledge Graph: Node Leaf parses
[[Wiki Link]]syntax in your Markdown files and runs a local Markov Chain (NodeRank) algorithm to map the most important "Hubs" in your research network. - Interactive Reading: Citations
[Doc X]and[[Wiki Links]]generated by the AI or saved in your files are fully clickable, allowing you to seamlessly hop between nodes, source documents, and wiki pages. - Multi-Agent Debates (MoE): Run VRAM-efficient, multi-persona debates (e.g., The Visionary, The Skeptic, The Archivist) to automatically map ontological gaps in your research and suggest new Wiki pages.
- 100% Local & Private: Connects directly to your local Redleaf server and your local Ollama instance. No cloud APIs required.
- Project Management: Save and load your node layouts as
.nlffiles to resume your research later. - Graph Canvas: Infinite panning/zooming, lasso selection, copy/paste, and undo/redo support.
Node Leaf relies on a Directed Acyclic Graph (DAG) architecture. Data flows from top to bottom, accumulating context until it reaches an output node.
- ➕ Scratchpad: Your basic text building block. Write instructions, notes, or attach Redleaf Entity Pills. Now features a dual-tab Edit/Read interface.
- 🎭 Agent Persona: Define the role, tone, and perspective the AI should adopt.
- 🗺️ System Briefing: Automatically injects a high-level statistical overview of your Redleaf database.
- 📘 Wiki Reader: Loads a permanent Markdown (
.md) file from your local Wiki folder into the LLM context.
- 🔍 Global Search: Perform a full-text search across your database and feed the top snippets to the LLM.
- 📄 Document Reader: Fetch the full raw text of a specific Document ID.
- 🗂️ Catalog Reader: Extract context from an entire user-created collection.
- 🔗 Graph Relationship: Pull structured connection data (Triplets) for a specific entity from the Redleaf Knowledge Graph.
- 🎯 Co-Mention: Find specific pages where multiple entities are mentioned together.
- ✨ Ollama Output: Compiles all upstream context and generates a final written response.
- 📝 Summarizer: A direct, high-speed execution node that bypasses agent loops to instantly process and summarize upstream context.
- 💬 Ollama Chat: Turns your upstream context into a system prompt for a continuous, interactive chat session.
- 🤓 Deep Study (Geek Out): Enter a topic, and this autonomous agent will loop through Redleaf—searching, reading, and taking notes—until it has enough data to synthesize a master report.
- 🏕️ Research Party: Deploys a team of exploratory agents (Scout, Forager, Chronicler). They read your current Wiki to map the landscape, independently forage the Redleaf database for hard primary-source evidence, and synthesize a grounded "Campfire Report" to expand your knowledge base.
- 🖋️ Wiki Writer: Acts as a strict fact-checker. It compares upstream research against the current Wiki state, resolves contradictions, and permanently saves the updated knowledge to your local Markdown files. Includes UI controls to preview and restore older versions.
- 🏛️ Wiki Council: Simulates a Mixture of Experts (MoE) debate loop powered by your Wiki Knowledge Graph.
- Discovery Mode: Analyzes upstream research to suggest new Wiki pages that should be created.
- Audit Mode: Select a specific Wiki page and the Council will aggressively critique it against new data and output a proposed rewrite.
- Flutter SDK (Version 3.0+)
- Redleaf running on your local machine or LAN.
- Ollama installed with your preferred models (e.g.,
gemma3:12b,llama3).
-
Clone the repository:
git clone https://github.com/nathanfx330/node_leaf.git cd node_leaf -
Install dependencies:
flutter pub get
-
Run the app (Desktop highly recommended):
flutter run -d macos # or windows, linux
When you first launch Node Leaf, click the Settings (⚙️) icon in the top right corner.
- Connect to Redleaf:
Enter your Redleaf Flask API URL (e.g.,
http://127.0.0.1:5000), along with your Redleaf admin username and password. Click "Connect & Save". - Connect to Ollama:
Enter your Ollama URL (e.g.,
http://127.0.0.1:11434).
💡 LAN Setup Tip: If Ollama is running on a different computer than Node Leaf, the host machine must run Ollama with the environment variable
OLLAMA_HOST=0.0.0.0to accept external connections.
- Delete / Backspace: Delete selected nodes
- Ctrl/Cmd + C: Copy selected node
- Ctrl/Cmd + V: Paste node
- Ctrl/Cmd + Z: Undo
- Ctrl/Cmd + S: Save Project
- Ctrl/Cmd + Shift + S: Save Project As
- Ctrl/Cmd + O: Open Project
- Shift + Click: Add to current selection
- Shift + Drag Node over Wire: Insert node into an existing connection
This project is licensed under the MIT License.
MIT License
Copyright (c) 2026 Nathaniel Westveer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

