Skip to content

Improve monorepo support by separating memory and LSP context #1260

@arikon

Description

@arikon

Is your feature request related to a problem? Please describe.
Yes. Serena is hard to use in very large monorepos where many logically separate projects live in the same repository, but parts of the codebase are still connected through dependencies.

In this setup, I want LSPs to run from the monorepo root so navigation, references, and dependency resolution work across the whole repository. At the same time, I want .serena/memory to stay project-specific, so each logical project can have its own isolated memory/context.

Right now, activate_project switches both:

  • the memory context, and
  • the code/LSP root.

That makes it difficult to use Serena effectively in large monorepos, because switching to a project also narrows the LSP scope to that project root.

Describe the solution you'd like
It would be great to decouple memory context from code/LSP context.

A few possible ways to support this:

  • Add a configuration option that changes activate_project so it only switches memory, while keeping the current code/LSP root unchanged.
  • Or add separate commands for switching only the memory context without affecting LSPs / code indexing scope.

This would make it possible to:

  • run LSPs from the monorepo root,
  • keep full cross-project code intelligence,
  • and still have separate .serena/memory contexts for individual projects.

Describe alternatives you've considered
The main alternative is using activate_project as-is, but that does not work well because it switches both memory and LSP context together.

Another option is to use a single shared memory for the whole monorepo, but in practice that becomes too noisy and mixes context from unrelated projects.

Additional context
This is mainly relevant for very large enterprise monorepos containing many unrelated codebases in one repository.

In that kind of setup:

  • project boundaries are logical, not repo-based,
  • dependencies can span multiple projects,
  • LSPs need repo-wide visibility,
  • but memory should stay isolated per project.

A feature that allows switching memory independently from LSP/code context would make Serena much more usable in this scenario.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions