The ability to integrate modular electronics into ingestible magnetic robots can enhance their functionality. However, ingestible devices are fundamentally limited by size constraints and flexible crawler robots lack capacity for bulky, rigid components and payloads. Here we create a centralized compartment in a magnetic crawler robot to enhance its functionality while preserving its ingestible form factor and bidirectional locomotion.