IWE and OpenAI: Turning Markdown Notes into a Knowledge Graph for AI Agents

A detailed walkthrough shows how to use IWE to build a local knowledge graph from markdown notes and connect an AI agent to it. The example covers note search, retrieval that traverses links, OpenAI function calling, AI transformations of documents and multi-hop reasoning. The result: the model answers questions about architecture, deployment and performance using the whole knowledge structure, not a single file.

AI-processed from MarkTechPost; edited by Hamidun News
IWE and OpenAI: Turning Markdown Notes into a Knowledge Graph for AI Agents
Source: MarkTechPost. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceMarkTechPost ↗
Editor-in-Chief
Key metric #1find — searches for relevant notes by query
Key metric #2retrieve — pulls a document together with its linked context
Key metric #3tree — shows the hierarchy and a map of sections

A walkthrough built on IWE shows how to turn a set of markdown notes into a full knowledge graph for people and AI agents. On top of it, the authors built agentic RAG, plugged in OpenAI function calling and taught the model to find answers through the links between documents rather than in flat files.

A graph instead of a folder

The example is based on IWE, a local Rust tool for working with notes via CLI and LSP. The idea is simple: each markdown page becomes a graph node, while wiki links and regular markdown links become directed edges between nodes. This way notes can be not only read but also traversed as a connected structure, where every document has context, neighbors and a hierarchy.

The tutorial author first assembles a small knowledge base for a developer: architecture, authentication, database, API, frontend, deployment, caching and performance notes. A KnowledgeGraph object is then built from these files, parsing headings, tags and links. On top of it, the basic IWE operations are implemented to show that the graph is useful not just for storage but also for navigation and analytics.

  • find — searches for relevant notes by query
  • retrieve — pulls a document together with its linked context
  • tree — shows the hierarchy and a map of sections
  • squash — merges several linked documents into one
  • export dot — prepares a graph visualization via Graphviz

Where OpenAI comes in

The next layer is AI transformation of documents. The article builds an ai_transform function that sends a note to an OpenAI model and applies one of five modes: rewrite, summarize, expand, extract_todos or generate_links. In other words, the same knowledge base no longer just stores structure; it automatically rewrites, condenses, extends and links its own nodes.

In the demo this looks practical rather than academic. The system briefly summarizes the authentication note, suggests new wiki links for it and extracts a task list from the performance note. Importantly, the AI does not work in a separate sandbox or on an export into a vector database, but directly on top of the same graph the developer uses in the editor.

The agent traverses the graph

The most interesting part is agentic RAG on top of the knowledge graph. Four tools are defined for the agent: iwe_find, iwe_retrieve, iwe_tree and iwe_stats. Through OpenAI function calling, the model decides for itself when to look for an entry point, when to read a linked document, when to view the section tree and when to request overall statistics for the base. A search-retrieve-synthesize loop then runs until the agent assembles an answer.

In the examples, the agent answers questions about the authentication system's dependencies, the deployment pipeline and the overall project architecture. The author then goes further: the AI looks for gaps in the graph, generates a new note on an error-handling strategy, adds it to the base and updates the visualization. The final test is a multi-hop question about load growing from 1000 to 5000 RPS, where the model has to connect the database, caching, tokens and infrastructure rather than retell a single file.

What this means

This case shows where practical RAG for developers is heading. Instead of yet another layer on top of vector search, IWE proposes using a personal knowledge base as shared memory for human and agent: with explicit links, graph traversal, local storage and controlled AI actions.

For teams, this is an important signal: value increasingly lies not in the model itself, but in how well your context is organized and accessible.

Story

Key Questions Answered

What are the key details on A graph instead of a folder?

The example is based on IWE, a local Rust tool for working with notes via CLI and LSP. The idea is simple: each markdown page becomes a graph node, while wiki links and regular markdown links become directed edges between nodes. This way notes can be not only read but also traversed as a connected structure, where every document has context, neighbors and a hierarchy. The tutorial author first assembles a small knowledge base for a developer: architecture, authentication, database, API, frontend, deployment, caching and performance notes. A KnowledgeGraph object is then bui

Where OpenAI comes in?

The next layer is AI transformation of documents. The article builds an ai_transform function that sends a note to an OpenAI model and applies one of five modes: rewrite, summarize, expand, extract_todos or generate_links. In other words, the same knowledge base no longer just stores structure; it automatically rewrites, condenses, extends and links its own nodes. In the demo this looks practical rather than academic. The system briefly summarizes the authentication note, suggests new wiki links for it and extracts a task list from the performance note. Importantly, the AI

What are the key details on The agent traverses the graph?

The most interesting part is agentic RAG on top of the knowledge graph. Four tools are defined for the agent: iwe_find, iwe_retrieve, iwe_tree and iwe_stats. Through OpenAI function calling, the model decides for itself when to look for an entry point, when to read a linked document, when to view the section tree and when to request overall statistics for the base. A search-retrieve-synthesize loop then runs until the agent assembles an answer. In the examples, the agent answers questions about the authentication system's dependencies, the deployment pipeline and the overal

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
What do you think?
Loading comments…