Build an AI CRM in Obsidian: Named Markdown Files + Codex Chat Queries for Contact Management
Store contact notes as named markdown files in Obsidian's /crm folder and query them via Codex chat. A zero-cost CRM that lives in plain text.
Your CRM Is Just a Folder of Markdown Files
Salesforce costs $25 per user per month at the Starter tier. HubSpot’s free plan caps out fast. And both of them require you to remember to open them. The CRM module described here costs nothing, lives in a folder called /crm inside your Obsidian vault, and you query it by typing “Where did I meet Matthew Berman?” into a Codex chat window.
That’s the whole pitch. Contact notes stored as named markdown files — one file per person — queryable via natural language through Codex. No database, no SaaS subscription, no import/export friction. Just plain text that an AI agent can read, write, and reason over.
The system comes from a video by @mreflow, who built it as the CRM layer of a larger second brain architecture originally sketched by Andrej Karpathy. The CRM module is self-contained enough to build and use on its own, even if you never touch the wiki or journal pieces.
Here’s how to build it.
Why a Markdown CRM Is Worth Taking Seriously
Most CRMs fail for the same reason most second brains fail: the friction of entry is higher than the value of retrieval. You meet someone at a conference, you mean to log the conversation later, and you never do. Or you do log it, but the interface is slow enough that you stop after three entries.
Remy doesn't build the plumbing. It inherits it.
Other agents wire up auth, databases, models, and integrations from scratch every time you ask them to build something.
Remy ships with all of it from MindStudio — so every cycle goes into the app you actually want.
A markdown file named Matthew-Berman.md takes two seconds to create. You can write in it from any text editor, any terminal, any AI coding environment. There’s no schema to conform to, no required fields, no loading spinner.
The retrieval side is where the AI layer earns its keep. Instead of searching through a list of contacts, you just ask: “What did I know about the person I met at TechCrunch Disrupt in 2025?” Codex reads the /crm folder, finds the relevant file, and answers. It also cross-references your journal entries and wiki pages if you’ve built those out — but the CRM works as a standalone module even if you haven’t.
One underappreciated property of this setup: because everything is markdown, any agent can work from the same vault. Codex, Claude Code, or any other tool that can read a directory will have full access to your contact records without any migration or export step. The files are the database. This is also why the system is genuinely portable — if you switch AI tools next year, your CRM comes with you.
If you’re already building with AI agents for personal productivity, a markdown CRM slots in naturally alongside task automation and note-taking workflows. It’s the same substrate.
What You Need Before You Start
Obsidian — free at obsidian.md. This is the visibility layer. It renders your markdown files, shows you the folder structure, and lets you navigate and edit contact records without touching a terminal.
Codex — OpenAI’s coding agent, available as a desktop app. Free tier exists; you’ll get more throughput on a paid plan. This is the AI layer that reads and writes your markdown files.
A vault — if you’re starting fresh, create a new Obsidian vault and note the folder path on your machine. You’ll point Codex at this folder as a project.
A GitHub account (optional but recommended) — for backup. You’ll create a private repository and configure Codex to push after each processing run.
You don’t need the Obsidian Web Clipper for the CRM module specifically, though you’ll want it if you’re building the full second brain system. You don’t need any API keys beyond what Codex already uses.
Building the CRM Module, Step by Step
Step 1: Create the folder structure
Inside your Obsidian vault, create a folder called crm. That’s it. This is where every contact record will live.
You should also have an agents.md file at the root of your vault. This is the plain-text prompt file that governs all agent behavior — think of it as the system prompt for your entire vault. If you’re building the CRM module standalone, create agents.md now with a blank file. You’ll populate it in the next step.
Also create log.md and index.md at the root. The log tracks every action the agent takes. The index is the catalog — in the CRM context, it becomes an alphabetical list of contacts with short summaries.
Now you have a vault with /crm, agents.md, log.md, and index.md. Open Codex, click “Add new project,” select “Use an existing folder,” and point it at your vault directory.
Step 2: Write the CRM rules into agents.md
- ✕a coding agent
- ✕no-code
- ✕vibe coding
- ✕a faster Cursor
The one that tells the coding agents what to build.
Open Codex with your vault as the active project. In a new chat, paste something like this:
Update the agents.md file to handle CRM entries. If I tell you I’m giving you information for the CRM, either update the person in the CRM or add the person to the CRM. CRM files should always be named after the person. I will share details about a person — their name, contact details, where or how we met, things I know about them. Create or update the contact record in the CRM folder with whatever details I give you. In the CRM folder, create an index file with the names of people in the CRM listed alphabetically and a short bio of what information I have about each person. Log every CRM update in log.md.
Codex will update agents.md with a CRM section and create the index file inside /crm. When you open Obsidian, you’ll see /crm/index.md with empty columns for person and summary.
Now you have a vault with CRM rules baked into the agent’s operating instructions.
Step 3: Add your first contact
In Codex, open a new chat inside your vault project. Type something like:
Add to CRM: Matthew Berman. Met at Qualcomm event in 2024. Hung out at CES in 2025. Got lunch during TechCrunch Disrupt in 2025.
Codex will create Matthew-Berman.md inside /crm with structured sections: summary, contact details (empty if you didn’t provide them), how you met, relationship context. It will also update /crm/index.md with his name and a one-line summary, and append an entry to log.md.
Open Obsidian. Under the /crm folder, you’ll see Matthew-Berman.md. Click it. The file will have front matter at the top and structured sections below — all editable directly in Obsidian if you want to add notes manually.
Now you have a contact record that any AI agent can read.
Step 4: Query your contacts
This is the part that makes the system worth building. In a new Codex chat, ask:
Where did I meet Matthew Berman?
Codex checks the vault, reads the CRM records, and responds: “You met Matthew Berman at a Qualcomm event in 2024. According to your CRM note, you also saw him at CES in 2025 and had lunch during TechCrunch Disrupt in 2025.”
The query works because Codex has access to the entire vault directory. It reads the index first, then pulls the relevant file. If you’ve also built the wiki and journal layers, it can cross-reference those too — surfacing conversations you had with this person that connect to ideas you’ve been thinking about.
The demo in the source video shows exactly this: a natural language query returning a specific, sourced answer from a named markdown file. No search UI, no filters, no columns to sort.
Now you have a CRM you can talk to.
Step 5: Set up the model and (optionally) automate
Day one: idea. Day one: app.
Not a sprint plan. Not a quarterly OKR. A finished product by end of day.
For processing and querying, the video recommends GPT-4.5 (referred to as GPT 5.5 in the source) on High reasoning in Codex. Use the strongest model available to you — the quality of the structured output in your contact files depends on it.
For backup, create a private GitHub repository, copy the URL, and tell Codex: “Commit this current version to my private GitHub repo” with the URL pasted in. After the initial push, you can add a line to your Codex automation: “Once everything is processed, commit and push the current version to the main branch on GitHub.”
If you’re also running the wiki ingestion pipeline, you’ll already have an hourly Codex automation set up under the Automations tab. You can extend that automation to also check for any CRM updates that need indexing. But for the CRM module alone, manual chat queries are sufficient — you’re not ingesting raw files, you’re just adding and querying records.
Now you have a CRM that backs itself up to GitHub after every run.
The Failure Modes Worth Knowing About
The index gets out of sync. If you manually edit a contact file in Obsidian without going through Codex, the index won’t update automatically. Fix: tell Codex to “reindex the CRM folder” and it will rebuild /crm/index.md from the actual files. This is a one-line prompt, not a manual task.
Codex creates the wrong file name. If you give it a name with unusual characters or a very long name, the file might get created with a sanitized version that doesn’t match what you expect. Check the file name in Obsidian after creation. If it’s wrong, rename it in Obsidian and tell Codex the correct name for future reference.
Queries return nothing when the vault is large. As your vault grows, Codex may not always read every file in a single context window. The index file exists precisely to solve this — it gives the agent a compact map of the vault before it dives into individual files. Make sure your agents.md instructs the agent to always check the index first. If queries are missing contacts, check whether the index is current.
The log grows unbounded. log.md will accumulate every CRM entry, query, and update indefinitely. This is fine for months, but eventually you may want to archive older entries. A simple prompt — “Archive log entries older than 90 days to log-archive.md” — handles this.
You forget to add people. This is the real failure mode, and no amount of automation fixes it. The system only knows what you tell it. The friction of adding a contact via Codex chat is low, but it’s not zero. Some people find it helpful to batch-add contacts after events rather than one at a time.
This is also where the broader architecture matters. If you’re building the self-evolving Claude Code memory system with Obsidian, the same vault directory can serve both systems — your contact records and your session logs living side by side, both queryable through the same interface.
Where to Take This Further
The CRM module as described is a starting point. A few directions worth considering:
Connect contacts to wiki pages. The agents.md instruction to cross-link generated wiki pages back to source files can be extended to contacts. If you save a YouTube video from someone in your CRM, tell the agent to link their contact record to the wiki page generated from that video. Over time, you get a graph where people connect to ideas, tools, and conversations.
Add a journal trigger. The journal layer in the full second brain system is configured to look at the CRM when you write an entry. If you journal about a meeting or a conversation, the agent checks whether the person is in your CRM and surfaces relevant context. This is where the system starts to feel less like a database and more like a thinking partner. The Andrej Karpathy LLM wiki knowledge base post covers the wiki architecture that makes this cross-referencing possible.
Build a proper front-end if you need one. The markdown CRM works well for personal use. If you’re building something for a team or want a proper UI, the architecture changes. Tools like Remy take a different approach: you write a spec — annotated markdown — and a full-stack app gets compiled from it, including a TypeScript backend, SQLite database, auth, and deployment. For a team CRM with shared access and structured fields, that’s the path.
Swap the AI agent. Because the vault is just markdown files in a directory, you’re not locked into Codex. Claude Code works from the same folder. So does any other agent that can read a local directory. The build an AI second brain with Claude Code and Obsidian post walks through the Claude Code version of this setup if you prefer Anthropic’s tooling.
Add meeting notes automatically. The video mentions Granola as a tool for recording and transcribing meetings. Those transcripts can be dropped into /raw and processed by the hourly automation, with the agent instructed to check whether any people mentioned in the transcript are in the CRM and update their records accordingly. This closes the loop between conversations you have and the records you keep.
If you want to orchestrate this kind of multi-step workflow — ingesting transcripts, updating CRM records, cross-referencing wiki pages — without writing the orchestration code yourself, MindStudio offers a no-code path with 200+ models and 1,000+ pre-built integrations, including connections to tools like HubSpot and Notion if you want to sync your markdown CRM with an existing system.
The graph view in Obsidian is worth checking periodically as you add contacts and content. A vault that starts as a handful of files becomes a visible network of interconnected nodes — people linked to ideas, ideas linked to sources, sources linked to journal entries. It’s a different way of seeing what you know and who you know.
The system isn’t magic. It’s a folder of text files and an AI that can read them. That’s also why it works.