### Verify ClawMem Tools with Example Calls Source: https://github.com/yoloshii/clawmem/blob/main/docs/guides/setup-mcp.md Demonstrates how to verify the ClawMem MCP server setup by calling exposed tools. Includes examples for `memory_retrieve` and `status`. ```python memory_retrieve("test query") status() ``` -------------------------------- ### Clone and Install Dependencies with Bun Source: https://github.com/yoloshii/clawmem/blob/main/docs/contributing.md Clones the ClawMem repository and installs project dependencies using Bun. This is the initial setup step for development. ```bash git clone https://github.com/yoloshii/clawmem.git cd clawmem bun install ``` -------------------------------- ### Install and Bootstrap ClawMem CLI Source: https://context7.com/yoloshii/clawmem/llms.txt Installs ClawMem globally using npm or Bun and bootstraps a new vault with a single command. The bootstrap command initializes the vault, indexes content, generates embeddings, sets up hooks, and starts the MCP server. ```bash # Install globally npm install -g clawmem # Or with Bun: bun add -g clawmem # Bootstrap a vault: init + index + embed + hooks + MCP in one command clawmem bootstrap ~/notes --name notes # Verify installation clawmem doctor ``` -------------------------------- ### Manage HTTP REST API Source: https://github.com/yoloshii/clawmem/blob/main/README.md Commands to start the ClawMem REST API server and perform search operations. Includes examples for running the server with optional authentication and executing a hybrid search request. ```bash ./bin/clawmem serve ./bin/clawmem serve --port 8080 CLAWMEM_API_TOKEN=secret ./bin/clawmem serve ``` ```bash curl -X POST http://localhost:7438/search \ -H 'Content-Type: application/json' \ -d '{"query": "authentication decisions", "mode": "hybrid", "compact": true}' ``` -------------------------------- ### Install and Bootstrap ClawMem Source: https://github.com/yoloshii/clawmem/blob/main/SKILL.md Commands to clone the repository, install dependencies, and initialize a new memory vault. ```bash git clone https://github.com/yoloshii/clawmem.git ~/clawmem cd ~/clawmem && bun install ln -sf ~/clawmem/bin/clawmem ~/.bun/bin/clawmem # Bootstrap a vault clawmem bootstrap ~/notes --name notes # Manual setup steps ./bin/clawmem init ./bin/clawmem collection add ~/notes --name notes ./bin/clawmem update --embed ./bin/clawmem setup hooks ./bin/clawmem setup mcp ``` -------------------------------- ### Install ClawMem from Source Source: https://github.com/yoloshii/clawmem/blob/main/AGENTS.md Clones the ClawMem repository, installs dependencies, and creates a symbolic link for the CLI. This method is useful for development or when using the latest code. ```bash # Or from source git clone https://github.com/yoloshii/clawmem.git ~/clawmem cd ~/clawmem && bun install ln -sf ~/clawmem/bin/clawmem ~/.bun/bin/clawmem ``` -------------------------------- ### Install Default Claude Code Hooks (Bash) Source: https://github.com/yoloshii/clawmem/blob/main/docs/guides/setup-hooks.md This command installs the default Claude Code hooks into the user's Claude settings file (`~/.claude/settings.json`). It automates the setup process for essential hooks like context surfacing and session management. ```bash ./bin/clawmem setup hooks ``` -------------------------------- ### Setup Integrations CLI Source: https://context7.com/yoloshii/clawmem/llms.txt Configures ClawMem for integration with AI coding agents. Installs Claude Code hooks for automatic context injection, registers the MCP server, and sets up the OpenClaw ContextEngine plugin. ```bash # Install Claude Code hooks (automatic context injection) clawmem setup hooks # Remove installed hooks clawmem setup hooks --remove # Register MCP server in ~/.claude.json clawmem setup mcp # Setup OpenClaw ContextEngine plugin clawmem setup openclaw # Install curator maintenance agent clawmem setup curator ``` -------------------------------- ### Bootstrap and Configure ClawMem Source: https://github.com/yoloshii/clawmem/blob/main/README.md Commands to initialize the ClawMem workspace, enable real-time auto-embedding, and install the background watcher service. ```bash # Bootstrap workspace collection ./bin/clawmem bootstrap ~/workspace --name workspace # Bootstrap each project ./bin/clawmem bootstrap ~/Projects/my-project --name my-project # Enable auto-embed for real-time indexing # Edit ~/.config/clawmem/config.yaml → autoEmbed: true # Install watcher as systemd service ./bin/clawmem install-service --enable ``` -------------------------------- ### Enable and Start Systemd Services Source: https://github.com/yoloshii/clawmem/blob/main/AGENTS.md Commands to reload systemd, enable the watcher service and embed timer, and start them immediately. It also configures services to persist across reboots. ```bash # Enable and start systemctl --user daemon-reload systemctl --user enable --now clawmem-watcher.service clawmem-embed.timer # Persist across reboots (start without login) loginctl enable-linger $(whoami) # Verify systemctl --user status clawmem-watcher.service clawmem-embed.timer ``` -------------------------------- ### Install and Bootstrap ClawMem Source: https://github.com/yoloshii/clawmem/blob/main/CLAUDE.md Commands to install ClawMem via package managers or source, followed by the initialization and setup process for a new vault. ```bash # Install via npm bun add -g clawmem # Or from source git clone https://github.com/yoloshii/clawmem.git ~/clawmem cd ~/clawmem && bun install ln -sf ~/clawmem/bin/clawmem ~/.bun/bin/clawmem # Bootstrap a vault clawmem bootstrap ~/notes --name notes # Step by step setup ./bin/clawmem init ./bin/clawmem collection add ~/notes --name notes ./bin/clawmem update --embed ./bin/clawmem setup hooks ./bin/clawmem setup mcp ``` -------------------------------- ### Start LLM Server for Intent Classification Source: https://github.com/yoloshii/clawmem/blob/main/README.md Downloads and initializes the Qwen3-1.7B model via llama-server to handle intent classification and query expansion. ```bash wget https://huggingface.co/tobil/qmd-query-expansion-1.7B-gguf/resolve/main/qmd-query-expansion-1.7B-q4_k_m.gguf llama-server -m qmd-query-expansion-1.7B-q4_k_m.gguf \ --port 8089 --host 0.0.0.0 \ -ngl 99 -c 4096 --batch-size 512 ``` -------------------------------- ### Verify Installation Source: https://github.com/yoloshii/clawmem/blob/main/README.md Commands to perform system health checks, check index status, and run the project test suite. ```bash ./bin/clawmem doctor ./bin/clawmem status bun test ``` -------------------------------- ### ClawMem Step-by-Step Setup Source: https://github.com/yoloshii/clawmem/blob/main/AGENTS.md Provides a sequence of commands to manually set up a ClawMem vault, including initialization, adding collections, embedding, and setting up background services. ```bash # Or step by step: ./bin/clawmem init ./bin/clawmem collection add ~/notes --name notes ./bin/clawmem update --embed ./bin/clawmem setup hooks ./bin/clawmem setup mcp ``` -------------------------------- ### Service and Plugin Configuration Source: https://github.com/yoloshii/clawmem/blob/main/AGENTS.md Commands to start the REST API server or register the OpenClaw context engine plugin. ```bash # Start the optional REST API server clawmem serve --port 7438 # Register ClawMem as an OpenClaw context engine clawmem setup openclaw ``` -------------------------------- ### Manual Configuration of Claude Code Hooks (JSON) Source: https://github.com/yoloshii/clawmem/blob/main/docs/guides/setup-hooks.md This JSON configuration allows for manual setup of Claude Code hooks. It specifies commands to run for different events (e.g., UserPromptSubmit, SessionStart, Stop) and includes timeout settings for each hook. Replace `/path/to/clawmem` with the actual installation path. ```json { "hooks": { "UserPromptSubmit": [ { "type": "command", "command": "timeout 8 /path/to/clawmem hook context-surfacing" } ], "SessionStart": [ { "type": "command", "command": "timeout 5 /path/to/clawmem hook curator-nudge" }, { "type": "command", "command": "timeout 5 /path/to/clawmem hook postcompact-inject" } ], "PreCompact": [ { "type": "command", "command": "timeout 5 /path/to/clawmem hook precompact-extract" } ], "Stop": [ { "type": "command", "command": "timeout 10 /path/to/clawmem hook decision-extractor" }, { "type": "command", "command": "timeout 10 /path/to/clawmem hook handoff-generator" }, { "type": "command", "command": "timeout 10 /path/to/clawmem hook feedback-loop" } ] } } ``` -------------------------------- ### ClawMem Setup Hooks Source: https://github.com/yoloshii/clawmem/blob/main/CLAUDE.md Command to set up or re-run ClawMem hooks, particularly if using an older installation or experiencing issues with hook timeouts. ```bash clawmem setup hooks ``` -------------------------------- ### Download zembed-1 Model Source: https://github.com/yoloshii/clawmem/blob/main/README.md Download the zembed-1-Q4_K_M model file using wget. This model is used for embedding operations and is recommended for GPU setups with ample VRAM. ```bash wget https://huggingface.co/Abhiray/zembed-1-Q4_K_M-GGUF/resolve/main/zembed-1-Q4_K_M.gguf ``` -------------------------------- ### Install ClawMem MCP Server Source: https://github.com/yoloshii/clawmem/blob/main/docs/guides/setup-mcp.md Installs ClawMem as an MCP stdio server. For Claude Code, it updates the ~/.claude.json configuration file. ```bash ./bin/clawmem setup mcp ``` -------------------------------- ### Setup Systemd Background Services Source: https://context7.com/yoloshii/clawmem/llms.txt Creates and enables systemd user services for persistent file watching, scheduled embedding tasks, and REST API hosting. ```bash cat > ~/.config/systemd/user/clawmem-watcher.service << 'EOF' [Unit] Description=ClawMem file watcher After=default.target [Service] Type=simple ExecStart=%h/.bun/bin/clawmem watch Restart=on-failure RestartSec=10 [Install] WantedBy=default.target EOF cat > ~/.config/systemd/user/clawmem-embed.timer << 'EOF' [Unit] Description=ClawMem daily embedding sweep [Timer] OnCalendar=*-*-* 04:00:00 Persistent=true [Install] WantedBy=timers.target EOF cat > ~/.config/systemd/user/clawmem-serve.service << 'EOF' [Unit] Description=ClawMem REST API server [Service] Type=simple ExecStart=%h/.bun/bin/clawmem serve --port 7438 Restart=on-failure Environment=CLAWMEM_API_TOKEN=your-secret [Install] WantedBy=default.target EOF systemctl --user daemon-reload systemctl --user enable --now clawmem-watcher.service clawmem-embed.timer loginctl enable-linger $(whoami) ``` -------------------------------- ### Install ClawMem Agent Source: https://github.com/yoloshii/clawmem/blob/main/SKILL.md Installs the ClawMem agent globally using npm or bun. This command makes the `clawmem` executable available in your system's PATH. ```bash # Install via npm bun add -g clawmem # or: npm install -g clawmem ``` -------------------------------- ### Enable and Start ClawMem Services (Bash) Source: https://github.com/yoloshii/clawmem/blob/main/docs/guides/systemd-services.md Provides commands to enable and start ClawMem systemd user services. It includes reloading the daemon, enabling and starting the watcher and embed timer, and persisting services across reboots using `loginctl enable-linger`. ```bash mkdir -p ~/.config/systemd/user systemctl --user daemon-reload systemctl --user enable --now clawmem-watcher.service clawmem-embed.timer # Persist across reboots (start without login) loginctl enable-linger $(whoami) ``` -------------------------------- ### Configure MCP Server Source: https://github.com/yoloshii/clawmem/blob/main/README.md Methods for registering the ClawMem MCP server. Supports automatic setup via CLI or manual configuration in JSON format for MCP-compatible clients. ```bash ./bin/clawmem setup mcp ``` ```json { "mcpServers": { "clawmem": { "command": "/absolute/path/to/clawmem/bin/clawmem", "args": ["mcp"] } } } ``` -------------------------------- ### Start ClawMem Server Source: https://github.com/yoloshii/clawmem/blob/main/docs/reference/rest-api.md Commands to initialize the ClawMem server instance. Supports custom port configuration and optional Bearer token authentication. ```bash ./bin/clawmem serve # localhost:7438, no auth ./bin/clawmem serve --port 8080 # custom port CLAWMEM_API_TOKEN=secret ./bin/clawmem serve # with bearer token auth ``` -------------------------------- ### Configure Local Embedding Server Source: https://github.com/yoloshii/clawmem/blob/main/README.md Commands to start a local llama-server for embedding tasks. Supports both GPU-accelerated and CPU-only execution modes. ```bash llama-server -m zembed-1-Q4_K_M.gguf \ --embeddings --port 8088 --host 0.0.0.0 \ -ngl 99 -c 8192 -b 2048 -ub 2048 ``` ```bash wget https://huggingface.co/ggml-org/embeddinggemma-300M-GGUF/resolve/main/embeddinggemma-300M-Q8_0.gguf # On GPU llama-server -m embeddinggemma-300M-Q8_0.gguf \ --embeddings --port 8088 --host 0.0.0.0 \ -ngl 99 -c 2048 --batch-size 2048 # On CPU llama-server -m embeddinggemma-300M-Q8_0.gguf \ --embeddings --port 8088 --host 0.0.0.0 \ -c 2048 --batch-size 2048 ``` -------------------------------- ### Bootstrap ClawMem Vault Source: https://github.com/yoloshii/clawmem/blob/main/AGENTS.md Initializes, indexes, embeds, and sets up hooks for a new ClawMem vault. This command automates the initial setup of a notes directory. ```bash # Bootstrap a vault (init + index + embed + hooks + MCP) clawmem bootstrap ~/notes --name notes ``` -------------------------------- ### Configure and Run ClawMem Server Source: https://github.com/yoloshii/clawmem/blob/main/docs/reference/cli.md Commands to start the REST API server with configurable host and port options. The server facilitates programmatic access to the memory engine. ```bash clawmem serve clawmem serve --port 8080 clawmem serve --host 0.0.0.0 ``` -------------------------------- ### Install ClawMem as OpenClaw Plugin Source: https://github.com/yoloshii/clawmem/blob/main/docs/guides/openclaw-plugin.md Registers the ClawMem binary as a context engine plugin within the OpenClaw environment. ```bash ./bin/clawmem setup openclaw ``` -------------------------------- ### ClawMem OpenClaw Setup Source: https://github.com/yoloshii/clawmem/blob/main/CLAUDE.md Command to register ClawMem as a native OpenClaw context engine. This enables features like prompt-aware retrieval and turn-based extraction. ```bash clawmem setup openclaw ``` -------------------------------- ### Configure Systemd Background Services Source: https://github.com/yoloshii/clawmem/blob/main/SKILL.md Setup scripts for systemd user units to handle automatic file watching and periodic embedding tasks. ```bash mkdir -p ~/.config/systemd/user # clawmem-watcher.service cat > ~/.config/systemd/user/clawmem-watcher.service << 'EOF' [Unit] Description=ClawMem file watcher — auto-indexes on .md changes After=default.target [Service] Type=simple ExecStart=%h/clawmem/bin/clawmem watch Restart=on-failure RestartSec=10 [Install] WantedBy=default.target EOF # clawmem-embed.service cat > ~/.config/systemd/user/clawmem-embed.service << 'EOF' [Unit] Description=ClawMem embedding sweep [Service] Type=oneshot ExecStart=%h/clawmem/bin/clawmem embed EOF # clawmem-embed.timer cat > ~/.config/systemd/user/clawmem-embed.timer << 'EOF' [Unit] Description=ClawMem daily embedding sweep [Timer] OnCalendar=*-*-* 04:00:00 Persistent=true RandomizedDelaySec=300 [Install] WantedBy=timers.target EOF # Enable and start services systemctl --user daemon-reload systemctl --user enable --now clawmem-watcher.service clawmem-embed.timer loginctl enable-linger $(whoami) ``` -------------------------------- ### List Configured ClawMem Vaults Source: https://github.com/yoloshii/clawmem/blob/main/docs/guides/multi-vault-config.md Display a list of all configured ClawMem vaults and their corresponding file paths. This command helps in verifying the active vault configurations. ```python list_vaults() ``` -------------------------------- ### Curator Agent Setup Source: https://github.com/yoloshii/clawmem/blob/main/CLAUDE.md Command to install the Curator Agent, a maintenance tool for ClawMem. ```bash clawmem setup curator ``` -------------------------------- ### Configure Reranker Server with llama.cpp Source: https://github.com/yoloshii/clawmem/blob/main/README.md Instructions for setting up the reranker server using llama.cpp. Includes commands for downloading the GGUF model and launching the server with specific parameters for GPU or CPU environments. ```bash wget https://huggingface.co/keisuke-miyako/zerank-2-gguf-q4_k_m/resolve/main/zerank-2-Q4_k_m.gguf # -ub must match -b for non-causal attention llama-server -m zerank-2-Q4_K_M.gguf \ --reranking --port 8090 --host 0.0.0.0 \ -ngl 99 -c 2048 -b 2048 -ub 2048 ``` ```bash wget https://huggingface.co/ggml-org/Qwen3-Reranker-0.6B-Q8_0-GGUF/resolve/main/Qwen3-Reranker-0.6B-Q8_0.gguf llama-server -m Qwen3-Reranker-0.6B-Q8_0.gguf \ --reranking --port 8090 --host 0.0.0.0 \ -ngl 99 -c 2048 --batch-size 512 ``` -------------------------------- ### Query Specific ClawMem Vaults (MCP) Source: https://github.com/yoloshii/clawmem/blob/main/docs/guides/multi-vault-config.md Execute queries against specific ClawMem vaults using the `vault` parameter in MCP tools. This allows for targeted information retrieval from independent memory spaces. Examples include searching, checking lifecycle status, and pinning memories. ```python # Search work vault query("API authentication flow", vault="work", compact=true) # Check personal vault lifecycle lifecycle_status(vault="personal") # Pin something in research vault memory_pin("important finding", vault="research") ``` -------------------------------- ### YAML Frontmatter Example Source: https://github.com/yoloshii/clawmem/blob/main/docs/concepts/composite-scoring.md Example of YAML frontmatter that can be added to documents to improve their quality score. Includes title, type, and date. ```yaml --- title: Switch from REST to gRPC for internal services type: decision date: 2026-03-15 --- ``` -------------------------------- ### Enable ClawMem REST API Service (Bash) Source: https://github.com/yoloshii/clawmem/blob/main/docs/guides/systemd-services.md Enables and starts the ClawMem REST API systemd user service. This command ensures the API server is running and will start automatically on system boot. ```bash systemctl --user enable --now clawmem-serve.service ``` -------------------------------- ### POST /v1/chat/completions Source: https://github.com/yoloshii/clawmem/blob/main/AGENTS.md Generates chat completions using the QMD query expansion model. ```APIDOC ## POST /v1/chat/completions ### Description Generates a chat completion response. Note: ClawMem automatically appends /no_think to prompts to ensure structured output. ### Method POST ### Endpoint http://:8089/v1/chat/completions ### Request Body - **messages** (array) - Required - List of message objects. - **model** (string) - Required - The model identifier. ### Request Example { "model": "qmd-query-expansion-1.7B", "messages": [{"role": "user", "content": "Explain quantum computing"}] } ### Response #### Success Response (200) - **choices** (array) - The generated completion choices. #### Response Example { "choices": [{"message": {"content": "Quantum computing is..."}}] } ``` -------------------------------- ### Prevent Local Model Downloads in Remote Setups Source: https://github.com/yoloshii/clawmem/blob/main/README.md Set the CLAWMEM_NO_LOCAL_MODELS environment variable to true when using remote GPU setups. This prevents node-llama-cpp from auto-downloading multi-GB model files if a server is unreachable, ensuring faster failover. ```bash export CLAWMEM_NO_LOCAL_MODELS=true ``` -------------------------------- ### Remove Claude Code Hooks (Bash) Source: https://github.com/yoloshii/clawmem/blob/main/docs/guides/setup-hooks.md This command removes the previously installed default Claude Code hooks from the user's Claude settings. It reverts the `~/.claude/settings.json` file to its state before hook installation. ```bash ./bin/clawmem setup hooks --remove ``` -------------------------------- ### GET /documents/:docid Source: https://github.com/yoloshii/clawmem/blob/main/README.md Retrieves a single document from the vault using its unique identifier. ```APIDOC ## GET /documents/:docid ### Description Fetches the full content and metadata of a specific document using a 6-char hash prefix. ### Method GET ### Endpoint /documents/:docid ### Parameters #### Path Parameters - **docid** (string) - Required - The 6-character hash prefix of the document. ### Response #### Success Response (200) - **id** (string) - Document ID - **content** (string) - Document body - **metadata** (object) - Associated document metadata ``` -------------------------------- ### Memory Analysis and Consolidation Commands Source: https://github.com/yoloshii/clawmem/blob/main/AGENTS.md CLI tools for performing cross-session reflection and automated document consolidation to manage memory growth. ```bash # Cross-session reflection (last 14 days default) clawmem reflect 14 # Find and archive duplicate low-confidence documents clawmem consolidate --dry-run ``` -------------------------------- ### IO6 Surface Integration Commands Source: https://github.com/yoloshii/clawmem/blob/main/AGENTS.md Commands for integrating ClawMem with external processes using stdin pipes for context injection and session bootstrapping. ```bash # IO6a: per-prompt context injection echo "user query" | clawmem surface --context --stdin # IO6b: per-session bootstrap injection echo "session-id" | clawmem surface --bootstrap --stdin ``` -------------------------------- ### get Source: https://github.com/yoloshii/clawmem/blob/main/docs/reference/mcp-tools.md Retrieves a single document using its file path or unique document ID. ```APIDOC ## GET /get ### Description Retrieve a single document by path or docid. ### Method GET ### Endpoint /get ### Parameters #### Query Parameters - **file** (string) - Required - File path or docid (`#abc123`) - **fromLine** (number) - Optional - Start line - **maxLines** (number) - Optional - Line limit - **lineNumbers** (boolean) - Optional - Include line numbers (Default: false) - **vault** (string) - Optional - Named vault ### Request Example ```json { "file": "/path/to/document.txt", "fromLine": 50, "maxLines": 10, "lineNumbers": true } ``` ### Response #### Success Response (200) - **content** (string) - The content of the requested document or lines. - **metadata** (object) - Document metadata. ``` -------------------------------- ### GET /v1/models Source: https://github.com/yoloshii/clawmem/blob/main/SKILL.md Retrieves information about the models currently loaded in the inference services. ```APIDOC ## GET /v1/models ### Description Returns a list of models available on the specified inference service (LLM or Reranker). ### Method GET ### Endpoint http://host:8089/v1/models (LLM) or http://host:8090/v1/models (Reranker) ### Response #### Success Response (200) - **object** (string) - The response type. - **data** (array) - List of available model objects. #### Response Example { "object": "list", "data": [ { "id": "qmd-query-expansion-1.7B-q4_k_m", "object": "model", "owned_by": "clawmem" } ] } ``` -------------------------------- ### Bootstrap OpenClaw Workspace Source: https://github.com/yoloshii/clawmem/blob/main/README.md Specific bootstrap command for initializing the OpenClaw workspace directory. ```bash # OpenClaw uses ~/.openclaw/workspace/ as its workspace root ./bin/clawmem bootstrap ~/.openclaw/workspace --name workspace ``` -------------------------------- ### Configure and Launch llama-server Instances Source: https://github.com/yoloshii/clawmem/blob/main/CLAUDE.md Commands to initialize embedding, LLM, and reranker services using llama-server. Includes configurations for both default and SOTA performance profiles, noting specific requirements for batch sizes and GPU offloading. ```bash # === Default (QMD native combo) === # Embedding (--embeddings flag required) llama-server -m embeddinggemma-300M-Q8_0.gguf \ --embeddings --port 8088 --host 0.0.0.0 -ngl 99 -c 2048 --batch-size 2048 # LLM (QMD finetuned model) llama-server -m qmd-query-expansion-1.7B-q4_k_m.gguf \ --port 8089 --host 0.0.0.0 -ngl 99 -c 4096 --batch-size 512 # Reranker llama-server -m Qwen3-Reranker-0.6B-Q8_0.gguf \ --reranking --port 8090 --host 0.0.0.0 -ngl 99 -c 2048 --batch-size 512 # === SOTA upgrade (12GB+ GPU) — -ub must match -b for non-causal attention === # Embedding llama-server -m zembed-1-Q4_K_M.gguf \ --embeddings --port 8088 --host 0.0.0.0 -ngl 99 -c 8192 -b 2048 -ub 2048 # Reranker llama-server -m zerank-2-Q4_K_M.gguf \ --reranking --port 8090 --host 0.0.0.0 -ngl 99 -c 2048 -b 2048 -ub 2048 ``` -------------------------------- ### GET /graph/causal/:docid Source: https://github.com/yoloshii/clawmem/blob/main/docs/reference/rest-api.md Traverses the causal chain for a specific document. ```APIDOC ## GET /graph/causal/:docid ### Description Traverses the causal chain related to the provided document hash. ### Method GET ### Endpoint /graph/causal/:docid ### Parameters #### Path Parameters - **docid** (string) - Required - The 6-char hash prefix #### Query Parameters - **direction** (string) - Optional - 'before', 'after', or 'both' - **depth** (integer) - Optional - Traversal depth ``` -------------------------------- ### GET /documents/:docid Source: https://github.com/yoloshii/clawmem/blob/main/docs/reference/rest-api.md Retrieves a single document by its hash prefix. ```APIDOC ## GET /documents/:docid ### Description Retrieves a single document using its 6-character hash prefix. ### Method GET ### Endpoint /documents/:docid ### Parameters #### Path Parameters - **docid** (string) - Required - The 6-char hash prefix of the document ### Response #### Success Response (200) - **docid** (string) - Document identifier - **path** (string) - File path - **title** (string) - Document title - **body** (string) - Document content ``` -------------------------------- ### Setup Default ClawMem Inference Services with llama-server Source: https://github.com/yoloshii/clawmem/blob/main/AGENTS.md This bash script sets up the default ClawMem inference services using llama-server. It configures the embedding, LLM, and reranker models with specified ports, host, and GPU layers. Ensure the model files (.gguf) are present in the directory. ```bash # === Default (QMD native combo) === # Embedding (--embeddings flag required) llama-server -m embeddinggemma-300M-Q8_0.gguf \ --embeddings --port 8088 --host 0.0.0.0 -ngl 99 -c 2048 --batch-size 2048 # LLM (QMD finetuned model) llama-server -m qmd-query-expansion-1.7B-q4_k_m.gguf \ --port 8089 --host 0.0.0.0 -ngl 99 -c 4096 --batch-size 512 # Reranker llama-server -m Qwen3-Reranker-0.6B-Q8_0.gguf \ --reranking --port 8090 --host 0.0.0.0 -ngl 99 -c 2048 --batch-size 512 ``` -------------------------------- ### Accessing ClawMem SKILL.md Reference (Bash) Source: https://github.com/yoloshii/clawmem/blob/main/README.md Bash command to locate and display the path to the ClawMem SKILL.md file, which contains detailed operational guidance. ```bash CLAWMEM_ROOT=$(cd "$(dirname "$(which clawmem)")/.." && pwd) && echo "$CLAWMEM_ROOT/SKILL.md" ```