docs: update project scoping to use git remote for cross-machine consistency

This commit is contained in:
Lukas Parsons 2026-03-23 00:33:26 -04:00
parent 2a87dfafcf
commit bae42fb141
3 changed files with 19 additions and 4 deletions

View file

@ -137,6 +137,8 @@ The template includes a working agent integration and docker-compose setup. See
- Stores decisions, configurations, learnings
- Retrieved via `/memory?project=...`
**Project scoping**: Use a stable identifier for the `project` parameter (e.g., git remote URL like `https://github.com/username/repo`). This ensures your project's conventions and memories follow you across machines, even if file paths differ. The template agent auto-detects the git remote.
## MCP Server Integration
If you use Claude Desktop, add to your config:

View file

@ -191,9 +191,13 @@ Edit `.env` if needed:
```env
API_URL=http://helm:8675
API_KEY= # Only if auth enabled
PROJECT=/path/to/your/project # Optional, for context scoping
# PROJECT= # Optional. If not set, agent auto-detects git remote origin (recommended)
```
**Project scoping**: The `PROJECT` variable determines how conventions and memories are scoped. We recommend using the git remote origin URL (e.g., `https://github.com/username/repo.git`) as a stable identifier that follows you across machines, even if file paths differ. If `PROJECT` is not set, the agent automatically detects the git remote origin (if the working directory is a git repository). This ensures your project's knowledge base is consistent regardless of where you clone the repo.
For non-git directories, set `PROJECT` to any unique string that identifies the project across machines.
#### 3. Run Your Agent
```bash

View file

@ -251,11 +251,20 @@ decisions = resp.json()["entries"]
### Starting a New Session
1. **Define your project identifier** - a path or unique string:
1. **Define your project identifier** - we recommend using git remote origin for consistency across machines:
```python
PROJECT = "/home/user/myapp" # or "my-discord-bot", "workspace-123"
# Option A: Auto-detect (recommended) - agent template does this automatically
project = get_project_identifier() # returns git remote origin if available, else env var, else dir name
# Option B: Explicit project identifier (stable across machines)
PROJECT = "git@github.com:username/repo.git" # or "https://github.com/username/repo"
# Option C: Use environment variable
# export PROJECT="git@github.com:username/repo.git"
```
**Why git remote?** If you work on the same repository from multiple machines (different file paths), using the git remote as the project identifier ensures your conventions and memories follow you. The same repo gets the same context regardless of where you clone it.
2. **Load past memories** (optional but helpful):
```python
memories = httpx.get("http://helm:8675/memory", params={"project": PROJECT}).json()["entries"]
@ -284,7 +293,7 @@ If your agent works across multiple projects:
```python
# Switch project context mid-conversation
PROJECT = "/home/user/project1" # current active project
PROJECT = "git@github.com:company/project-a.git" # stable identifier
# Each project has its own conventions and memories
context = await get_context(query, project=PROJECT)