What happened?
gbrain put and gbrain import CLI commands always write to the default source regardless of context. gbrain sync --strategy code creates per-project sources automatically, but any user-imported data (conversations, documents, etc.) is lumped into default.
In a multi-project setup, this means:
- Code is properly isolated per source (via
sync --strategy code)
- But user-imported data from all projects is mixed in
default
- MCP search with
sourceIds filter cannot exclude cross-project conversation data, making source-level isolation ineffective for manually imported content
What did you expect?
gbrain put and gbrain import should support a --source flag to specify the target source:
gbrain put <slug> --content "..." --source my-project
gbrain import <dir> --source my-project
Alternatively, gbrain put could read source_id from the YAML frontmatter of the imported markdown content.
Better yet: support a per-project config file at <project-root>/.gbrain/config.json that overrides the global ~/.gbrain/config.json. Projects can then define their own source_id in this local config, and all put/import/query commands run inside that project directory will automatically use the configured source instead of default. This follows the same pattern as .env / eslintrc — local overrides global.
Steps to reproduce
- Run
gbrain sync --strategy code . — creates a source like repo-code-xxxx with code pages
- Run
gbrain put my-page --content "---\ntitle: test\n---\nhello" — page goes to default
- Run
mcp__gbrain__search with sourceIds: ["repo-code-xxxx"] — still returns default pages
- The
sourceIds filter cannot exclude cross-project content because user data is all in default
Environment
- gbrain version: 0.37.0.0
- OS: Windows 11
- Bun version: 1.3.14
- Database: self-hosted PostgreSQL 16 (pgvector)
gbrain doctor --json output
{
"schema_version": 2,
"status": "warnings",
"health_score": 70,
"checks": [
{"name": "connection", "status": "ok", "message": "Connected, 500+ pages"},
{"name": "embedding_provider", "status": "warn", "message": "local model (1024d)"},
{"name": "schema_version", "status": "ok", "message": "Version 78 (latest: 78)"},
{"name": "embedding_width_consistency", "status": "ok", "message": "Schema width (1024d) matches embedding_dimensions config"}
]
}
What happened?
gbrain putandgbrain importCLI commands always write to thedefaultsource regardless of context.gbrain sync --strategy codecreates per-project sources automatically, but any user-imported data (conversations, documents, etc.) is lumped intodefault.In a multi-project setup, this means:
sync --strategy code)defaultsourceIdsfilter cannot exclude cross-project conversation data, making source-level isolation ineffective for manually imported contentWhat did you expect?
gbrain putandgbrain importshould support a--sourceflag to specify the target source:Alternatively,
gbrain putcould readsource_idfrom the YAML frontmatter of the imported markdown content.Better yet: support a per-project config file at
<project-root>/.gbrain/config.jsonthat overrides the global~/.gbrain/config.json. Projects can then define their ownsource_idin this local config, and allput/import/querycommands run inside that project directory will automatically use the configured source instead ofdefault. This follows the same pattern as.env/eslintrc— local overrides global.Steps to reproduce
gbrain sync --strategy code .— creates a source likerepo-code-xxxxwith code pagesgbrain put my-page --content "---\ntitle: test\n---\nhello"— page goes todefaultmcp__gbrain__searchwithsourceIds: ["repo-code-xxxx"]— still returnsdefaultpagessourceIdsfilter cannot exclude cross-project content because user data is all indefaultEnvironment
gbrain doctor --jsonoutput{ "schema_version": 2, "status": "warnings", "health_score": 70, "checks": [ {"name": "connection", "status": "ok", "message": "Connected, 500+ pages"}, {"name": "embedding_provider", "status": "warn", "message": "local model (1024d)"}, {"name": "schema_version", "status": "ok", "message": "Version 78 (latest: 78)"}, {"name": "embedding_width_consistency", "status": "ok", "message": "Schema width (1024d) matches embedding_dimensions config"} ] }