Is your feature request related to a problem or limitation?
I'm running Claude Code with a user-level ~/.claude/ and a per-project .claude/ setup. I'd like okf-agent-memory to implement that same idea, meaning there's a user-level ~/knowledge/ bundle for things true across every repo (e.g. web/programming research files) and a project-level ./knowledge/ for things that are true only in one repo.
The MCP server currently can only use a single bundle per call via bundle arg. Though, there is OKF_MCP_ROOT that I can use as a hack, it's only a single root, so one server instance can't reach both ~/knowledge and <project>/knowledge at the same time unless I set the it to something like $HOME, which looks ugly to me given create_concept and update_concept write through the same path check.
Though, this idea looks far fetched to me because this means dealing with ID collisions, handling graph builds and validations between user and project level, multi-root config shenanigans, etc.
Proposed Solution / Enhancement
Ideal: okf search to have an optional scope arg (user / project / default: both).
One server instance load an ordered list of bundles, each with a scope label, and search their union. Probably something like this in the config:
OKF_MCP_BUNDLES="user=/home/me/knowledge:project=./knowledge"
Not sure if this is the best approach but I'm open to alternatives.
Alternatives Considered
Current workaround is registering two MCP server instances, one for user scope and another at project scope, so the tools are named like mcp__okf-user__search and mcp__okf-project__search.
Although, this workaround have some limitations:
- Separate ranked list - Two bundles that are indexed separately produce separate scores, and merging the list result by score here probably doesn't work.
idf is derived from the per-bundle concept count:
|
N := float64(len(b.Concepts)) |
|
idf := math.Log(1.0 + (N-docFreq+0.5)/(docFreq+0.5)) |
- The agent has to remember to call both servers - Even if I tell the agent to query from both servers (in CLAUDE.md), it'll eventually forgets one server or the other and I have to keep reminding it via hook.
Additional Context
Claude Code
Is your feature request related to a problem or limitation?
I'm running Claude Code with a user-level
~/.claude/and a per-project.claude/setup. I'd likeokf-agent-memoryto implement that same idea, meaning there's a user-level~/knowledge/bundle for things true across every repo (e.g. web/programming research files) and a project-level./knowledge/for things that are true only in one repo.The MCP server currently can only use a single bundle per call via
bundlearg. Though, there isOKF_MCP_ROOTthat I can use as a hack, it's only a single root, so one server instance can't reach both~/knowledgeand<project>/knowledgeat the same time unless I set the it to something like$HOME, which looks ugly to me givencreate_conceptandupdate_conceptwrite through the same path check.Though, this idea looks far fetched to me because this means dealing with ID collisions, handling graph builds and validations between user and project level, multi-root config shenanigans, etc.
Proposed Solution / Enhancement
Ideal:
okf searchto have an optionalscopearg (user/project/ default:both).One server instance load an ordered list of bundles, each with a scope label, and search their union. Probably something like this in the config:
Not sure if this is the best approach but I'm open to alternatives.
Alternatives Considered
Current workaround is registering two MCP server instances, one for user scope and another at project scope, so the tools are named like
mcp__okf-user__searchandmcp__okf-project__search.Although, this workaround have some limitations:
idfis derived from the per-bundle concept count:okf-agent-memory/pkg/okf/search.go
Line 47 in b388dd7
okf-agent-memory/pkg/okf/search.go
Line 96 in b388dd7
Additional Context
Claude Code