From b501d45ed72d29bf623755f6703df8f4fc249751 Mon Sep 17 00:00:00 2001 From: Maximiliano Rios Date: Fri, 10 Apr 2026 19:28:30 -0400 Subject: [PATCH] chore: rename project from llmgraph to memex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renames all occurrences of llmgraph → memex: binary name, package name, .llmgraph/ directory (now .memex/), XML context tags, temp file prefixes, error messages, and all documentation. Also adds --goal flag to `memex node create` so agents and scripts can create nodes non-interactively without launching an editor. --- {.llmgraph => .memex}/.gitignore | 0 {.llmgraph => .memex}/config.toml | 0 {.llmgraph => .memex}/graph.json | 4 ++ .../0063801a-b3b6-475d-928a-74305810efe2.json | 0 .../795dad67-a2db-43a4-bcad-0cbf7ea46923.json | 0 .../925f8e38-6ed4-4bae-9424-2dc672c9cb64.json | 33 ++++++++++ .../b12d7577-0ce6-415b-872d-e1500a48e87a.json | 0 .../c1c47299-e44b-42da-bdb2-994c259c40cd.json | 0 CLAUDE.md | 18 +++--- Cargo.lock | 26 ++++---- Cargo.toml | 4 +- README.md | 64 +++++++++---------- src/commands/context.rs | 6 +- src/commands/init.rs | 6 +- src/commands/node.rs | 19 ++++-- src/editor.rs | 4 +- src/main.rs | 11 +++- src/store.rs | 26 ++++---- 18 files changed, 137 insertions(+), 84 deletions(-) rename {.llmgraph => .memex}/.gitignore (100%) rename {.llmgraph => .memex}/config.toml (100%) rename {.llmgraph => .memex}/graph.json (79%) rename {.llmgraph => .memex}/nodes/0063801a-b3b6-475d-928a-74305810efe2.json (100%) rename {.llmgraph => .memex}/nodes/795dad67-a2db-43a4-bcad-0cbf7ea46923.json (100%) create mode 100644 .memex/nodes/925f8e38-6ed4-4bae-9424-2dc672c9cb64.json rename {.llmgraph => .memex}/nodes/b12d7577-0ce6-415b-872d-e1500a48e87a.json (100%) rename {.llmgraph => .memex}/nodes/c1c47299-e44b-42da-bdb2-994c259c40cd.json (100%) diff --git a/.llmgraph/.gitignore b/.memex/.gitignore similarity index 100% rename from .llmgraph/.gitignore rename to .memex/.gitignore diff --git a/.llmgraph/config.toml b/.memex/config.toml similarity index 100% rename from .llmgraph/config.toml rename to .memex/config.toml diff --git a/.llmgraph/graph.json b/.memex/graph.json similarity index 79% rename from .llmgraph/graph.json rename to .memex/graph.json index f7575cb..c006e93 100644 --- a/.llmgraph/graph.json +++ b/.memex/graph.json @@ -13,6 +13,10 @@ { "from": "0063801a-b3b6-475d-928a-74305810efe2", "to": "b12d7577-0ce6-415b-872d-e1500a48e87a" + }, + { + "from": "b12d7577-0ce6-415b-872d-e1500a48e87a", + "to": "925f8e38-6ed4-4bae-9424-2dc672c9cb64" } ] } \ No newline at end of file diff --git a/.llmgraph/nodes/0063801a-b3b6-475d-928a-74305810efe2.json b/.memex/nodes/0063801a-b3b6-475d-928a-74305810efe2.json similarity index 100% rename from .llmgraph/nodes/0063801a-b3b6-475d-928a-74305810efe2.json rename to .memex/nodes/0063801a-b3b6-475d-928a-74305810efe2.json diff --git a/.llmgraph/nodes/795dad67-a2db-43a4-bcad-0cbf7ea46923.json b/.memex/nodes/795dad67-a2db-43a4-bcad-0cbf7ea46923.json similarity index 100% rename from .llmgraph/nodes/795dad67-a2db-43a4-bcad-0cbf7ea46923.json rename to .memex/nodes/795dad67-a2db-43a4-bcad-0cbf7ea46923.json diff --git a/.memex/nodes/925f8e38-6ed4-4bae-9424-2dc672c9cb64.json b/.memex/nodes/925f8e38-6ed4-4bae-9424-2dc672c9cb64.json new file mode 100644 index 0000000..7469d85 --- /dev/null +++ b/.memex/nodes/925f8e38-6ed4-4bae-9424-2dc672c9cb64.json @@ -0,0 +1,33 @@ +{ + "id": "925f8e38-6ed4-4bae-9424-2dc672c9cb64", + "parent_ids": [ + "b12d7577-0ce6-415b-872d-e1500a48e87a" + ], + "git_ref": "chore/rename-to-memex (d547d368)", + "created_at": "2026-04-10T23:22:47.684003Z", + "updated_at": "2026-04-10T23:30:00.000000Z", + "summary": { + "goal": "Rename project from llmgraph to memex throughout the codebase, and add --goal flag to node create for non-interactive (agent) use", + "decisions": [ + "Renamed binary, package, .llmgraph/ dir, XML context tags, temp file prefixes, and all user-facing strings from llmgraph to memex", + "Added --goal flag to `memex node create` that skips the editor entirely — agents can now create nodes in one non-interactive command", + "Updated CLAUDE.md to document --goal and use it in the node creation step of the dev workflow" + ], + "rejected_approaches": [], + "open_threads": [], + "key_artifacts": [ + "Cargo.toml", + "src/main.rs", + "src/store.rs", + "src/commands/init.rs", + "src/commands/context.rs", + "src/commands/node.rs", + "src/editor.rs", + "README.md", + "CLAUDE.md" + ] + }, + "raw_transcript_ref": null, + "tags": [], + "status": "Resolved" +} diff --git a/.llmgraph/nodes/b12d7577-0ce6-415b-872d-e1500a48e87a.json b/.memex/nodes/b12d7577-0ce6-415b-872d-e1500a48e87a.json similarity index 100% rename from .llmgraph/nodes/b12d7577-0ce6-415b-872d-e1500a48e87a.json rename to .memex/nodes/b12d7577-0ce6-415b-872d-e1500a48e87a.json diff --git a/.llmgraph/nodes/c1c47299-e44b-42da-bdb2-994c259c40cd.json b/.memex/nodes/c1c47299-e44b-42da-bdb2-994c259c40cd.json similarity index 100% rename from .llmgraph/nodes/c1c47299-e44b-42da-bdb2-994c259c40cd.json rename to .memex/nodes/c1c47299-e44b-42da-bdb2-994c259c40cd.json diff --git a/CLAUDE.md b/CLAUDE.md index f7e56db..73aabe8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,24 +1,24 @@ -# llmgraph — Agent Instructions +# memex — Agent Instructions ## What this project is -`llmgraph` is a CLI tool (Rust) that organizes LLM-assisted development into a versioned DAG of conversation nodes. It is a **storage and navigation layer**. +`memex` is a CLI tool (Rust) that organizes LLM-assisted development into a versioned DAG of conversation nodes. It is a **storage and navigation layer**. ## Development workflow -This project tracks its own development using `llmgraph`. Follow this pattern for every feature or fix: +This project tracks its own development using `memex`. Follow this pattern for every feature or fix: 1. **Branch** — `git checkout -b /` from `main` -2. **Node** — `llmgraph node create --parent ` before writing any code. Use a placeholder goal; you'll fill in the real summary later. +2. **Node** — `memex node create --parent --goal ""` before writing any code. You'll fill in the real summary with `memex node edit` later. 3. **Implement** the feature -4. **Summarize** — `llmgraph node edit` to write decisions, rejected approaches, and key artifacts. Do this yourself; do not add LLM API calls to automate it. -5. **Resolve** — `llmgraph node resolve` -6. **Commit** source changes and the updated `.llmgraph/` files together +4. **Summarize** — `memex node edit` to write decisions, rejected approaches, and key artifacts. Do this yourself; do not add LLM API calls to automate it. +5. **Resolve** — `memex node resolve` +6. **Commit** source changes and the updated `.memex/` files together 7. **Push** and open a PR ## What to commit -Always commit `.llmgraph/graph.json` and `.llmgraph/nodes/` alongside source changes — the conversation history is part of the project record. Never commit `.llmgraph/state.json`. +Always commit `.memex/graph.json` and `.memex/nodes/` alongside source changes — the conversation history is part of the project record. Never commit `.memex/state.json`. ## Architecture @@ -30,7 +30,7 @@ src/ editor.rs — $EDITOR integration via temp TOML file git.rs — git detection via subprocess (no libgit2) commands/ - init.rs — llmgraph init + init.rs — memex init node.rs — create, edit, show, list, resolve/abandon/reopen graph.rs — ASCII tree view context.rs — context payload generation (markdown/xml/plain) diff --git a/Cargo.lock b/Cargo.lock index 20f3126..9c965bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -318,7 +318,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] -name = "llmgraph" +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "memex" version = "0.1.0" dependencies = [ "anyhow", @@ -331,18 +343,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "log" -version = "0.4.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" - -[[package]] -name = "memchr" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" - [[package]] name = "num-traits" version = "0.2.19" diff --git a/Cargo.toml b/Cargo.toml index 41e3585..44a0969 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "llmgraph" +name = "memex" version = "0.1.0" edition = "2021" [[bin]] -name = "llmgraph" +name = "memex" path = "src/main.rs" [dependencies] diff --git a/README.md b/README.md index 2510e41..16b90d7 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# llmgraph +# memex A CLI tool for organizing LLM-assisted development work into a versioned, navigable DAG of conversation nodes tied to a software project. -LLM conversations are ephemeral and flat, but real development is hierarchical and branching. `llmgraph` gives each phase of work a structured node capturing what was built, what was decided, what was rejected, and what remains open. Edges represent context inheritance: each child node was started with knowledge of its parent. +LLM conversations are ephemeral and flat, but real development is hierarchical and branching. `memex` gives each phase of work a structured node capturing what was built, what was decided, what was rejected, and what remains open. Edges represent context inheritance: each child node was started with knowledge of its parent. --- @@ -10,7 +10,7 @@ LLM conversations are ephemeral and flat, but real development is hierarchical a ``` cargo build --release -cp target/release/llmgraph /usr/local/bin/ +cp target/release/memex /usr/local/bin/ ``` Or run directly from the project root: @@ -25,19 +25,19 @@ cargo run -- ```bash # Initialize a graph in your project -llmgraph init +memex init # Create a node for a new feature -llmgraph node create --parent +memex node create --parent # After your work session, fill in the summary -llmgraph node edit +memex node edit # Generate a context payload to paste into a new LLM conversation -llmgraph context +memex context # View the full conversation history as a tree -llmgraph graph view +memex graph view ``` --- @@ -46,17 +46,17 @@ llmgraph graph view | Command | Description | |---|---| -| `llmgraph init` | Initialize a graph in the current project | -| `llmgraph node create` | Create a new conversation node | -| `llmgraph node edit [id]` | Edit a node's summary in `$EDITOR` | -| `llmgraph node show [id]` | Display a node's full summary | -| `llmgraph node list` | List all nodes | -| `llmgraph node resolve [id]` | Mark a node as resolved | -| `llmgraph node abandon [id]` | Mark a node as abandoned | -| `llmgraph node reopen [id]` | Reopen a resolved or abandoned node | -| `llmgraph context [id]` | Generate a context payload for LLM injection | -| `llmgraph graph view` | ASCII tree of the full conversation graph | -| `llmgraph search ` | Search across all node summaries | +| `memex init` | Initialize a graph in the current project | +| `memex node create` | Create a new conversation node | +| `memex node edit [id]` | Edit a node's summary in `$EDITOR` | +| `memex node show [id]` | Display a node's full summary | +| `memex node list` | List all nodes | +| `memex node resolve [id]` | Mark a node as resolved | +| `memex node abandon [id]` | Mark a node as abandoned | +| `memex node reopen [id]` | Reopen a resolved or abandoned node | +| `memex context [id]` | Generate a context payload for LLM injection | +| `memex graph view` | ASCII tree of the full conversation graph | +| `memex search ` | Search across all node summaries | Node IDs can be shortened to any unambiguous prefix (e.g. `abc12345` → `abc1`). @@ -64,22 +64,22 @@ Node IDs can be shortened to any unambiguous prefix (e.g. `abc12345` → `abc1`) ## Development Workflow -`llmgraph` is used to track its own development. The pattern for any new feature: +`memex` is used to track its own development. The pattern for any new feature: 1. **Create a branch** - `git checkout -b feat/` -2. **Create a node** - `llmgraph node create --parent ` with a placeholder goal +2. **Create a node** - `memex node create --parent ` with a placeholder goal 3. **Implement** the feature -4. **Write the node summary** - `llmgraph node edit` to capture decisions, rejected approaches, and key artifacts -5. **Resolve the node** - `llmgraph node resolve` +4. **Write the node summary** - `memex node edit` to capture decisions, rejected approaches, and key artifacts +5. **Resolve the node** - `memex node resolve` 6. **Commit and push** - stage source changes and open a PR -The `llmgraph context` command generates a formatted summary of the ancestor chain suitable for pasting into a new LLM conversation, so future sessions can pick up where the last one left off without re-explaining history. +The `memex context` command generates a formatted summary of the ancestor chain suitable for pasting into a new LLM conversation, so future sessions can pick up where the last one left off without re-explaining history. --- ## Configuration -`llmgraph init` creates `.llmgraph/config.toml` at the project root. +`memex init` creates `.memex/config.toml` at the project root. ```toml [git] @@ -99,16 +99,16 @@ web_port = 7777 | Path | Committed | Notes | |---|---|---| -| `.llmgraph/config.toml` | Yes | Shared project settings | -| `.llmgraph/graph.json` | Yes | DAG edges and root node pointer | -| `.llmgraph/nodes/*.json` | Yes | Full conversation node history | -| `.llmgraph/state.json` | No | Local session state (active node) | -| `.llmgraph/transcripts/` | No | Raw transcripts, if stored locally | +| `.memex/config.toml` | Yes | Shared project settings | +| `.memex/graph.json` | Yes | DAG edges and root node pointer | +| `.memex/nodes/*.json` | Yes | Full conversation node history | +| `.memex/state.json` | No | Local session state (active node) | +| `.memex/transcripts/` | No | Raw transcripts, if stored locally | ### Storage layout ``` -.llmgraph/ +.memex/ config.toml # committed - shared settings graph.json # committed - DAG structure nodes/ @@ -120,7 +120,7 @@ web_port = 7777 ## Node Summary Format -When editing a node (`llmgraph node edit`), a TOML template is opened in `$EDITOR`: +When editing a node (`memex node edit`), a TOML template is opened in `$EDITOR`: ```toml goal = "What this conversation was working toward" diff --git a/src/commands/context.rs b/src/commands/context.rs index 9ef2ee8..34675f2 100644 --- a/src/commands/context.rs +++ b/src/commands/context.rs @@ -196,10 +196,10 @@ fn generate_xml( _target_id: Uuid, ) -> Result { let mut out = String::new(); - out.push_str("\n"); + out.push_str("\n"); if path.is_empty() { - out.push_str("\n"); + out.push_str("\n"); return Ok(out); } @@ -296,7 +296,7 @@ fn generate_xml( out.push_str(" \n"); } - out.push_str("\n"); + out.push_str("\n"); Ok(out) } diff --git a/src/commands/init.rs b/src/commands/init.rs index 9d7219d..6949a22 100644 --- a/src/commands/init.rs +++ b/src/commands/init.rs @@ -12,13 +12,13 @@ pub fn run() -> Result<()> { let store = GraphStore::open(cwd); if store.is_initialized() { - eprintln!("Warning: .llmgraph/ already exists. Skipping initialization."); + eprintln!("Warning: .memex/ already exists. Skipping initialization."); return Ok(()); } store.initialize()?; - println!("Initialized .llmgraph/ directory."); + println!("Initialized .memex/ directory."); // Detect git context let git_ref = if git::is_git_repo() { @@ -60,7 +60,7 @@ pub fn run() -> Result<()> { println!("\nCreated root node: {}", root_id); println!("Active node set to root."); - println!("\nTip: Use `llmgraph node create` to start a new conversation node."); + println!("\nTip: Use `memex node create` to start a new conversation node."); Ok(()) } diff --git a/src/commands/node.rs b/src/commands/node.rs index 954722b..c9c9387 100644 --- a/src/commands/node.rs +++ b/src/commands/node.rs @@ -10,6 +10,7 @@ pub fn create( parent: Option<&str>, git_ref: Option<&str>, tags: &[String], + goal: Option<&str>, ) -> Result<()> { let store = GraphStore::open_from_cwd()?; let mut graph = store.load_graph()?; @@ -32,11 +33,21 @@ pub fn create( None }; - // Open editor for summary - println!("Opening editor to fill in node summary..."); - let summary = editor::edit_node_summary(None)?; + // Use --goal directly or open editor + let summary = if let Some(g) = goal { + use crate::models::NodeSummary; + NodeSummary { + goal: g.to_string(), + decisions: Vec::new(), + rejected_approaches: Vec::new(), + open_threads: Vec::new(), + key_artifacts: Vec::new(), + } + } else { + println!("Opening editor to fill in node summary..."); + editor::edit_node_summary(None)? + }; - // Create node let mut node = ConversationNode::new(parent_ids.clone(), resolved_git_ref, tags.to_vec()); node.summary = summary; diff --git a/src/editor.rs b/src/editor.rs index 7ddf98e..97d7b13 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -19,7 +19,7 @@ pub fn edit_node_summary(existing: Option<&NodeSummary>) -> Result }; let tmp = Builder::new() - .prefix("llmgraph-node-") + .prefix("memex-node-") .suffix(".toml") .tempfile() .context("Failed to create temp file")?; @@ -46,7 +46,7 @@ pub fn edit_node_summary(existing: Option<&NodeSummary>) -> Result /// Open arbitrary text content in the editor, return the edited content. pub fn edit_text(initial: &str, suffix: &str) -> Result { let tmp = Builder::new() - .prefix("llmgraph-") + .prefix("memex-") .suffix(suffix) .tempfile() .context("Failed to create temp file")?; diff --git a/src/main.rs b/src/main.rs index 43cef1d..8c9ab05 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ use models::NodeStatus; #[derive(Parser)] #[command( - name = "llmgraph", + name = "memex", about = "Organize LLM conversations into a versioned, navigable DAG tied to a software project", version )] @@ -23,7 +23,7 @@ struct Cli { #[derive(Subcommand)] enum Commands { - /// Initialize a new llmgraph in the current directory + /// Initialize a new memex in the current directory Init, /// Manage conversation nodes @@ -70,6 +70,10 @@ enum NodeCommands { /// Tags to attach to this node #[arg(long, name = "tag", num_args = 1)] tags: Vec, + + /// Node goal (skips editor; required for non-interactive use) + #[arg(long)] + goal: Option, }, /// Edit a node's summary in $EDITOR @@ -125,11 +129,12 @@ fn run(cli: Cli) -> Result<()> { Commands::Init => commands::init::run(), Commands::Node { subcommand } => match subcommand { - NodeCommands::Create { parent, git_ref, tags } => { + NodeCommands::Create { parent, git_ref, tags, goal } => { commands::node::create( parent.as_deref(), git_ref.as_deref(), &tags, + goal.as_deref(), ) } NodeCommands::Edit { id } => commands::node::edit(id.as_deref()), diff --git a/src/store.rs b/src/store.rs index de7dc70..97e098c 100644 --- a/src/store.rs +++ b/src/store.rs @@ -11,11 +11,11 @@ pub struct GraphStore { } impl GraphStore { - /// Find the nearest `.llmgraph/` directory by walking up from `cwd`. + /// Find the nearest `.memex/` directory by walking up from `cwd`. pub fn find(cwd: &Path) -> Option { let mut dir = cwd.to_path_buf(); loop { - let candidate = dir.join(".llmgraph"); + let candidate = dir.join(".memex"); if candidate.is_dir() { return Some(dir); } @@ -25,7 +25,7 @@ impl GraphStore { } } - /// Open a store rooted at `root` (the project root, not the .llmgraph dir). + /// Open a store rooted at `root` (the project root, not the .memex dir). pub fn open(root: PathBuf) -> Self { GraphStore { root } } @@ -36,29 +36,29 @@ impl GraphStore { match Self::find(&cwd) { Some(root) => Ok(GraphStore::open(root)), None => bail!( - "No .llmgraph directory found. Run `llmgraph init` to initialize." + "No .memex directory found. Run `memex init` to initialize." ), } } - pub fn llmgraph_dir(&self) -> PathBuf { - self.root.join(".llmgraph") + pub fn memex_dir(&self) -> PathBuf { + self.root.join(".memex") } pub fn nodes_dir(&self) -> PathBuf { - self.llmgraph_dir().join("nodes") + self.memex_dir().join("nodes") } pub fn graph_path(&self) -> PathBuf { - self.llmgraph_dir().join("graph.json") + self.memex_dir().join("graph.json") } pub fn state_path(&self) -> PathBuf { - self.llmgraph_dir().join("state.json") + self.memex_dir().join("state.json") } pub fn config_path(&self) -> PathBuf { - self.llmgraph_dir().join("config.toml") + self.memex_dir().join("config.toml") } // ------------------------------------------------------------------------- @@ -66,12 +66,12 @@ impl GraphStore { // ------------------------------------------------------------------------- pub fn is_initialized(&self) -> bool { - self.llmgraph_dir().is_dir() + self.memex_dir().is_dir() } pub fn initialize(&self) -> Result<()> { - let dir = self.llmgraph_dir(); - fs::create_dir_all(&dir).context("Failed to create .llmgraph directory")?; + let dir = self.memex_dir(); + fs::create_dir_all(&dir).context("Failed to create .memex directory")?; fs::create_dir_all(self.nodes_dir()).context("Failed to create nodes directory")?; // Write default config if not present -- knotmirror 0.0.1